Voilà je sèche sur un coredump généré par la commande free (fin du code ci-dessous). Si je le mets en commentaire, pas de problème. Sinon le programme crashe

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
result = (char *)malloc(10*sizeof(char));
 if ( (result == NULL ) {
      // Not enough memory so stop execution and return failed
      strncpy(failureMessage, "Authentication failed. Not enought memory.\n", FAILURE_MSG_SIZE -1);
      failureMessage[FAILURE_MSG_SIZE] = (char)0;
      return QIPAUTHCALLOUT_FAIL;
   }
 
   result = getenv("AUTHCALLOUTDEBUG");
   if ( result != NULL ) {
      // check the value of result
      if ( strcmp(result,"ON") == 0 ) {
         // tracing is ON
         DEBUG = 1;
      }
   }
   /* Free up the memory space allocated to the result variable */
   free(result);