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


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

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

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

crypto/dso/dso_lib.c:134:9: 
132.           }
133.       } else
134. >         ret = dso;
135.       /* Don't load if we're currently already loaded */
136.       if (ret->filename != NULL) {

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

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

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

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

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

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

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

crypto/dso/dso_lib.c:250:5: 
  248.       }
  249.       /* We'll duplicate filename */
  250. >     copied = OPENSSL_strdup(filename);
  251.       if (copied == NULL) {
  252.           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:71:1: start of procedure CRYPTO_malloc()
      69.   }
      70.   
      71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      72.   {
      73.       void *ret = NULL;

crypto/mem.c:73:5: 
      71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      72.   {
      73. >     void *ret = NULL;
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
      73.       void *ret = NULL;
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                    ^
      76.           return malloc_impl(num, file, line);
      77.   

crypto/mem.c:78:9: Taking false branch
      76.           return malloc_impl(num, file, line);
      77.   
      78.       if (num <= 0)
                    ^
      79.           return NULL;
      80.   

crypto/mem.c:81:5: 
      79.           return NULL;
      80.   
      81. >     allow_customize = 0;
      82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
      89.       }
      90.   #else
      91. >     osslargused(file); osslargused(line);
      92.       ret = malloc(num);
      93.   #endif

crypto/mem.c:91:24: 
      89.       }
      90.   #else
      91. >     osslargused(file); osslargused(line);
      92.       ret = malloc(num);
      93.   #endif

crypto/mem.c:92:5: 
      90.   #else
      91.       osslargused(file); osslargused(line);
      92. >     ret = malloc(num);
      93.   #endif
      94.   

crypto/mem.c:95:5: 
      93.   #endif
      94.   
      95. >     return ret;
      96.   }
      97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
      94.   
      95.       return ret;
      96. > }
      97.   
      98.   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:251:9: Taking false branch
  249.       /* We'll duplicate filename */
  250.       copied = OPENSSL_strdup(filename);
  251.       if (copied == NULL) {
                 ^
  252.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_MALLOC_FAILURE);
  253.           return (0);

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

crypto/mem.c:163:1: start of procedure CRYPTO_free()
    161.   }
    162.   
    163. > void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking false branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     free(str);
    180.   #endif
    181.   }

crypto/mem.c:181:1: return from a call to CRYPTO_free
    179.       free(str);
    180.   #endif
    181. > }
    182.   
    183.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

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

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

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

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

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

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

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

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