crypto/dso/dso_lib.c:160: error: MEMORY_LEAK
  memory dynamically allocated by call to `DSO_set_filename()` at line 147, column 14 is not reachable after line 160, column 10.
Showing all 56 steps of the trace


crypto/dso/dso_lib.c:118:1: start of procedure DSO_load()
116.   }
117.   
118. > DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags)
119.   {
120.       DSO *ret;

crypto/dso/dso_lib.c:121:5: 
119.   {
120.       DSO *ret;
121. >     int allocated = 0;
122.   
123.       if (dso == NULL) {

crypto/dso/dso_lib.c:123:9: Taking true branch
121.       int allocated = 0;
122.   
123.       if (dso == NULL) {
               ^
124.           ret = DSO_new_method(meth);
125.           if (ret == NULL) {

crypto/dso/dso_lib.c:124:9: Skipping DSO_new_method(): empty list of specs
122.   
123.       if (dso == NULL) {
124.           ret = DSO_new_method(meth);
               ^
125.           if (ret == NULL) {
126.               DSOerr(DSO_F_DSO_LOAD, ERR_R_MALLOC_FAILURE);

crypto/dso/dso_lib.c:125:13: Taking false branch
123.       if (dso == NULL) {
124.           ret = DSO_new_method(meth);
125.           if (ret == NULL) {
                   ^
126.               DSOerr(DSO_F_DSO_LOAD, ERR_R_MALLOC_FAILURE);
127.               goto err;

crypto/dso/dso_lib.c:129:9: 
127.               goto err;
128.           }
129. >         allocated = 1;
130.           /* Pass the provided flags to the new DSO object */
131.           if (DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) {

crypto/dso/dso_lib.c:131:13: 
129.           allocated = 1;
130.           /* Pass the provided flags to the new DSO object */
131. >         if (DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) {
132.               DSOerr(DSO_F_DSO_LOAD, DSO_R_CTRL_FAILED);
133.               goto err;

crypto/dso/dso_lib.c:201:1: start of procedure DSO_ctrl()
  199.    * value as success/failure like usual ... but we conform when we must... :-)
  200.    */
  201. > long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg)
  202.   {
  203.       if (dso == NULL) {

crypto/dso/dso_lib.c:203:9: Taking false branch
  201.   long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg)
  202.   {
  203.       if (dso == NULL) {
                 ^
  204.           DSOerr(DSO_F_DSO_CTRL, ERR_R_PASSED_NULL_PARAMETER);
  205.           return (-1);

crypto/dso/dso_lib.c:211:5: 
  209.        * the method-specific ctrl() function if it's something we don't handle.
  210.        */
  211. >     switch (cmd) {
  212.       case DSO_CTRL_GET_FLAGS:
  213.           return dso->flags;

crypto/dso/dso_lib.c:212:5: Switch condition is false. Skipping switch case
  210.        */
  211.       switch (cmd) {
  212.       case DSO_CTRL_GET_FLAGS:
             ^
  213.           return dso->flags;
  214.       case DSO_CTRL_SET_FLAGS:

crypto/dso/dso_lib.c:214:5: Switch condition is true. Entering switch case
  212.       case DSO_CTRL_GET_FLAGS:
  213.           return dso->flags;
  214.       case DSO_CTRL_SET_FLAGS:
             ^
  215.           dso->flags = (int)larg;
  216.           return (0);

crypto/dso/dso_lib.c:215:9: 
  213.           return dso->flags;
  214.       case DSO_CTRL_SET_FLAGS:
  215. >         dso->flags = (int)larg;
  216.           return (0);
  217.       case DSO_CTRL_OR_FLAGS:

crypto/dso/dso_lib.c:216:9: 
  214.       case DSO_CTRL_SET_FLAGS:
  215.           dso->flags = (int)larg;
  216. >         return (0);
  217.       case DSO_CTRL_OR_FLAGS:
  218.           dso->flags |= (int)larg;

crypto/dso/dso_lib.c:228:1: return from a call to DSO_ctrl
  226.       }
  227.       return (dso->meth->dso_ctrl(dso, cmd, larg, parg));
  228. > }
  229.   
  230.   const char *DSO_get_filename(DSO *dso)

crypto/dso/dso_lib.c:131:13: Taking false branch
129.           allocated = 1;
130.           /* Pass the provided flags to the new DSO object */
131.           if (DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) {
                   ^
132.               DSOerr(DSO_F_DSO_LOAD, DSO_R_CTRL_FAILED);
133.               goto err;

crypto/dso/dso_lib.c:138:9: Taking false branch
136.           ret = dso;
137.       /* Don't load if we're currently already loaded */
138.       if (ret->filename != NULL) {
               ^
139.           DSOerr(DSO_F_DSO_LOAD, DSO_R_DSO_ALREADY_LOADED);
140.           goto err;

crypto/dso/dso_lib.c:146:9: Taking true branch
144.        * set.
145.        */
146.       if (filename != NULL)
               ^
147.           if (!DSO_set_filename(ret, filename)) {
148.               DSOerr(DSO_F_DSO_LOAD, DSO_R_SET_FILENAME_FAILED);

crypto/dso/dso_lib.c:147:14: 
145.        */
146.       if (filename != NULL)
147. >         if (!DSO_set_filename(ret, filename)) {
148.               DSOerr(DSO_F_DSO_LOAD, DSO_R_SET_FILENAME_FAILED);
149.               goto err;

crypto/dso/dso_lib.c:239:1: start of procedure DSO_set_filename()
  237.   }
  238.   
  239. > int DSO_set_filename(DSO *dso, const char *filename)
  240.   {
  241.       char *copied;

crypto/dso/dso_lib.c:243:10: Taking false branch
  241.       char *copied;
  242.   
  243.       if ((dso == NULL) || (filename == NULL)) {
                  ^
  244.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_PASSED_NULL_PARAMETER);
  245.           return (0);

crypto/dso/dso_lib.c:243:27: Taking false branch
  241.       char *copied;
  242.   
  243.       if ((dso == NULL) || (filename == NULL)) {
                                   ^
  244.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_PASSED_NULL_PARAMETER);
  245.           return (0);

crypto/dso/dso_lib.c:247:9: Taking false branch
  245.           return (0);
  246.       }
  247.       if (dso->loaded_filename) {
                 ^
  248.           DSOerr(DSO_F_DSO_SET_FILENAME, DSO_R_DSO_ALREADY_LOADED);
  249.           return (0);

crypto/dso/dso_lib.c:252:5: 
  250.       }
  251.       /* We'll duplicate filename */
  252. >     copied = OPENSSL_strdup(filename);
  253.       if (copied == NULL) {
  254.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_MALLOC_FAILURE);

crypto/o_str.c:28:1: start of procedure CRYPTO_strdup()
    26.   }
    27.   
    28. > char *CRYPTO_strdup(const char *str, const char* file, int line)
    29.   {
    30.       char *ret;

crypto/o_str.c:33:9: Taking false branch
    31.       size_t size;
    32.   
    33.       if (str == NULL)
                  ^
    34.           return NULL;
    35.       size = strlen(str) + 1;

crypto/o_str.c:35:5: 
    33.       if (str == NULL)
    34.           return NULL;
    35. >     size = strlen(str) + 1;
    36.       ret = CRYPTO_malloc(size, file, line);
    37.       if (ret != NULL)

crypto/o_str.c:36:5: 
    34.           return NULL;
    35.       size = strlen(str) + 1;
    36. >     ret = CRYPTO_malloc(size, file, line);
    37.       if (ret != NULL)
    38.           memcpy(ret, str, size);

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
      155.   #endif
      156.   
      157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      158.   {
      159.       void *ret = NULL;

crypto/mem.c:159:5: 
      157.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      158.   {
      159. >     void *ret = NULL;
      160.   
      161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:161:9: Taking false branch
      159.       void *ret = NULL;
      160.   
      161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      162.           return malloc_impl(num, file, line);
      163.   

crypto/mem.c:164:9: Taking false branch
      162.           return malloc_impl(num, file, line);
      163.   
      164.       if (num <= 0)
                     ^
      165.           return NULL;
      166.   

crypto/mem.c:168:5: 
      166.   
      167.       FAILTEST();
      168. >     allow_customize = 0;
      169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
      176.       }
      177.   #else
      178. >     osslargused(file); osslargused(line);
      179.       ret = malloc(num);
      180.   #endif

crypto/mem.c:178:24: 
      176.       }
      177.   #else
      178. >     osslargused(file); osslargused(line);
      179.       ret = malloc(num);
      180.   #endif

crypto/mem.c:179:5: 
      177.   #else
      178.       osslargused(file); osslargused(line);
      179. >     ret = malloc(num);
      180.   #endif
      181.   

crypto/mem.c:182:5: 
      180.   #endif
      181.   
      182. >     return ret;
      183.   }
      184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
      181.   
      182.       return ret;
      183. > }
      184.   
      185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:37:9: Taking true branch
    35.       size = strlen(str) + 1;
    36.       ret = CRYPTO_malloc(size, file, line);
    37.       if (ret != NULL)
                  ^
    38.           memcpy(ret, str, size);
    39.       return ret;

crypto/o_str.c:38:9: 
    36.       ret = CRYPTO_malloc(size, file, line);
    37.       if (ret != NULL)
    38. >         memcpy(ret, str, size);
    39.       return ret;
    40.   }

crypto/o_str.c:39:5: 
    37.       if (ret != NULL)
    38.           memcpy(ret, str, size);
    39. >     return ret;
    40.   }
    41.   

crypto/o_str.c:40:1: return from a call to CRYPTO_strdup
    38.           memcpy(ret, str, size);
    39.       return ret;
    40. > }
    41.   
    42.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/dso/dso_lib.c:253:9: Taking false branch
  251.       /* We'll duplicate filename */
  252.       copied = OPENSSL_strdup(filename);
  253.       if (copied == NULL) {
                 ^
  254.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_MALLOC_FAILURE);
  255.           return (0);

crypto/dso/dso_lib.c:257:5: 
  255.           return (0);
  256.       }
  257. >     OPENSSL_free(dso->filename);
  258.       dso->filename = copied;
  259.       return (1);

crypto/mem.c:252:1: start of procedure CRYPTO_free()
    250.   }
    251.   
    252. > void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:254:9: Taking false branch
    252.   void CRYPTO_free(void *str, const char *file, int line)
    253.   {
    254.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    255.           free_impl(str, file, line);
    256.           return;

crypto/mem.c:268:5: 
    266.       }
    267.   #else
    268. >     free(str);
    269.   #endif
    270.   }

crypto/mem.c:270:1: return from a call to CRYPTO_free
    268.       free(str);
    269.   #endif
    270. > }
    271.   
    272.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/dso/dso_lib.c:258:5: 
  256.       }
  257.       OPENSSL_free(dso->filename);
  258. >     dso->filename = copied;
  259.       return (1);
  260.   }

crypto/dso/dso_lib.c:259:5: 
  257.       OPENSSL_free(dso->filename);
  258.       dso->filename = copied;
  259. >     return (1);
  260.   }
  261.   

crypto/dso/dso_lib.c:260:1: return from a call to DSO_set_filename
  258.       dso->filename = copied;
  259.       return (1);
  260. > }
  261.   
  262.   char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2)

crypto/dso/dso_lib.c:147:14: Taking false branch
145.        */
146.       if (filename != NULL)
147.           if (!DSO_set_filename(ret, filename)) {
                    ^
148.               DSOerr(DSO_F_DSO_LOAD, DSO_R_SET_FILENAME_FAILED);
149.               goto err;

crypto/dso/dso_lib.c:151:5: 
149.               goto err;
150.           }
151. >     filename = ret->filename;
152.       if (filename == NULL) {
153.           DSOerr(DSO_F_DSO_LOAD, DSO_R_NO_FILENAME);

crypto/dso/dso_lib.c:152:9: Taking false branch
150.           }
151.       filename = ret->filename;
152.       if (filename == NULL) {
               ^
153.           DSOerr(DSO_F_DSO_LOAD, DSO_R_NO_FILENAME);
154.           goto err;

crypto/dso/dso_lib.c:156:9: Taking false branch
154.           goto err;
155.       }
156.       if (ret->meth->dso_load == NULL) {
               ^
157.           DSOerr(DSO_F_DSO_LOAD, DSO_R_UNSUPPORTED);
158.           goto err;

crypto/dso/dso_lib.c:160:10: Skipping __function_pointer__(): unresolved function pointer
158.           goto err;
159.       }
160.       if (!ret->meth->dso_load(ret)) {
                ^
161.           DSOerr(DSO_F_DSO_LOAD, DSO_R_LOAD_FAILED);
162.           goto err;
