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


crypto/dso/dso_lib.c:164:1: start of procedure DSO_load()
162.   }
163.   
164. > DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags)
165.   {
166.       DSO *ret;

crypto/dso/dso_lib.c:167:5: 
165.   {
166.       DSO *ret;
167. >     int allocated = 0;
168.   
169.       if (dso == NULL) {

crypto/dso/dso_lib.c:169:9: Taking true branch
167.       int allocated = 0;
168.   
169.       if (dso == NULL) {
               ^
170.           ret = DSO_new_method(meth);
171.           if (ret == NULL) {

crypto/dso/dso_lib.c:170:9: Skipping DSO_new_method(): empty list of specs
168.   
169.       if (dso == NULL) {
170.           ret = DSO_new_method(meth);
               ^
171.           if (ret == NULL) {
172.               DSOerr(DSO_F_DSO_LOAD, ERR_R_MALLOC_FAILURE);

crypto/dso/dso_lib.c:171:13: Taking false branch
169.       if (dso == NULL) {
170.           ret = DSO_new_method(meth);
171.           if (ret == NULL) {
                   ^
172.               DSOerr(DSO_F_DSO_LOAD, ERR_R_MALLOC_FAILURE);
173.               goto err;

crypto/dso/dso_lib.c:175:9: 
173.               goto err;
174.           }
175. >         allocated = 1;
176.           /* Pass the provided flags to the new DSO object */
177.           if (DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) {

crypto/dso/dso_lib.c:177:13: 
175.           allocated = 1;
176.           /* Pass the provided flags to the new DSO object */
177. >         if (DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0) {
178.               DSOerr(DSO_F_DSO_LOAD, DSO_R_CTRL_FAILED);
179.               goto err;

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

crypto/dso/dso_lib.c:249:9: Taking false branch
  247.   long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg)
  248.   {
  249.       if (dso == NULL) {
                 ^
  250.           DSOerr(DSO_F_DSO_CTRL, ERR_R_PASSED_NULL_PARAMETER);
  251.           return (-1);

crypto/dso/dso_lib.c:257:5: 
  255.        * the method-specific ctrl() function if it's something we don't handle.
  256.        */
  257. >     switch (cmd) {
  258.       case DSO_CTRL_GET_FLAGS:
  259.           return dso->flags;

crypto/dso/dso_lib.c:258:5: Switch condition is false. Skipping switch case
  256.        */
  257.       switch (cmd) {
  258.       case DSO_CTRL_GET_FLAGS:
             ^
  259.           return dso->flags;
  260.       case DSO_CTRL_SET_FLAGS:

crypto/dso/dso_lib.c:260:5: Switch condition is true. Entering switch case
  258.       case DSO_CTRL_GET_FLAGS:
  259.           return dso->flags;
  260.       case DSO_CTRL_SET_FLAGS:
             ^
  261.           dso->flags = (int)larg;
  262.           return (0);

crypto/dso/dso_lib.c:261:9: 
  259.           return dso->flags;
  260.       case DSO_CTRL_SET_FLAGS:
  261. >         dso->flags = (int)larg;
  262.           return (0);
  263.       case DSO_CTRL_OR_FLAGS:

crypto/dso/dso_lib.c:262:9: 
  260.       case DSO_CTRL_SET_FLAGS:
  261.           dso->flags = (int)larg;
  262. >         return (0);
  263.       case DSO_CTRL_OR_FLAGS:
  264.           dso->flags |= (int)larg;

crypto/dso/dso_lib.c:274:1: return from a call to DSO_ctrl
  272.       }
  273.       return (dso->meth->dso_ctrl(dso, cmd, larg, parg));
  274. > }
  275.   
  276.   const char *DSO_get_filename(DSO *dso)

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

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

crypto/dso/dso_lib.c:192:9: Taking true branch
190.        * set.
191.        */
192.       if (filename != NULL)
               ^
193.           if (!DSO_set_filename(ret, filename)) {
194.               DSOerr(DSO_F_DSO_LOAD, DSO_R_SET_FILENAME_FAILED);

crypto/dso/dso_lib.c:193:14: 
191.        */
192.       if (filename != NULL)
193. >         if (!DSO_set_filename(ret, filename)) {
194.               DSOerr(DSO_F_DSO_LOAD, DSO_R_SET_FILENAME_FAILED);
195.               goto err;

crypto/dso/dso_lib.c:285:1: start of procedure DSO_set_filename()
  283.   }
  284.   
  285. > int DSO_set_filename(DSO *dso, const char *filename)
  286.   {
  287.       char *copied;

crypto/dso/dso_lib.c:289:10: Taking false branch
  287.       char *copied;
  288.   
  289.       if ((dso == NULL) || (filename == NULL)) {
                  ^
  290.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_PASSED_NULL_PARAMETER);
  291.           return (0);

crypto/dso/dso_lib.c:289:27: Taking false branch
  287.       char *copied;
  288.   
  289.       if ((dso == NULL) || (filename == NULL)) {
                                   ^
  290.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_PASSED_NULL_PARAMETER);
  291.           return (0);

crypto/dso/dso_lib.c:293:9: Taking false branch
  291.           return (0);
  292.       }
  293.       if (dso->loaded_filename) {
                 ^
  294.           DSOerr(DSO_F_DSO_SET_FILENAME, DSO_R_DSO_ALREADY_LOADED);
  295.           return (0);

crypto/dso/dso_lib.c:298:5: 
  296.       }
  297.       /* We'll duplicate filename */
  298. >     copied = OPENSSL_strdup(filename);
  299.       if (copied == NULL) {
  300.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_MALLOC_FAILURE);

crypto/o_str.c:120:1: start of procedure CRYPTO_strdup()
    118.   }
    119.   
    120. > char *CRYPTO_strdup(const char *str, const char* file, int line)
    121.   {
    122.       char *ret;

crypto/o_str.c:125:9: Taking false branch
    123.       size_t size;
    124.   
    125.       if (str == NULL)
                   ^
    126.           return NULL;
    127.       size = strlen(str) + 1;

crypto/o_str.c:127:5: 
    125.       if (str == NULL)
    126.           return NULL;
    127. >     size = strlen(str) + 1;
    128.       ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)

crypto/o_str.c:128:5: 
    126.           return NULL;
    127.       size = strlen(str) + 1;
    128. >     ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)
    130.           memcpy(ret, str, size);

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
      117.   }
      118.   
      119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121.       void *ret = NULL;

crypto/mem.c:121:5: 
      119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121. >     void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

crypto/mem.c:129:5: 
      127.           return NULL;
      128.   
      129. >     allow_customize = 0;
      130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:139:24: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:140:5: 
      138.   #else
      139.       osslargused(file); osslargused(line);
      140. >     ret = malloc(num);
      141.   #endif
      142.   

crypto/mem.c:143:5: 
      141.   #endif
      142.   
      143. >     return ret;
      144.   }
      145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
      142.   
      143.       return ret;
      144. > }
      145.   
      146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:129:9: Taking true branch
    127.       size = strlen(str) + 1;
    128.       ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)
                   ^
    130.           memcpy(ret, str, size);
    131.       return ret;

crypto/o_str.c:130:9: 
    128.       ret = CRYPTO_malloc(size, file, line);
    129.       if (ret != NULL)
    130. >         memcpy(ret, str, size);
    131.       return ret;
    132.   }

crypto/o_str.c:131:5: 
    129.       if (ret != NULL)
    130.           memcpy(ret, str, size);
    131. >     return ret;
    132.   }
    133.   

crypto/o_str.c:132:1: return from a call to CRYPTO_strdup
    130.           memcpy(ret, str, size);
    131.       return ret;
    132. > }
    133.   
    134.   char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)

crypto/dso/dso_lib.c:299:9: Taking false branch
  297.       /* We'll duplicate filename */
  298.       copied = OPENSSL_strdup(filename);
  299.       if (copied == NULL) {
                 ^
  300.           DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_MALLOC_FAILURE);
  301.           return (0);

crypto/dso/dso_lib.c:303:5: 
  301.           return (0);
  302.       }
  303. >     OPENSSL_free(dso->filename);
  304.       dso->filename = copied;
  305.       return (1);

crypto/mem.c:210:1: start of procedure CRYPTO_free()
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:212:9: Taking false branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:226:5: 
    224.       }
    225.   #else
    226. >     free(str);
    227.   #endif
    228.   }

crypto/mem.c:228:1: return from a call to CRYPTO_free
    226.       free(str);
    227.   #endif
    228. > }
    229.   
    230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/dso/dso_lib.c:304:5: 
  302.       }
  303.       OPENSSL_free(dso->filename);
  304. >     dso->filename = copied;
  305.       return (1);
  306.   }

crypto/dso/dso_lib.c:305:5: 
  303.       OPENSSL_free(dso->filename);
  304.       dso->filename = copied;
  305. >     return (1);
  306.   }
  307.   

crypto/dso/dso_lib.c:306:1: return from a call to DSO_set_filename
  304.       dso->filename = copied;
  305.       return (1);
  306. > }
  307.   
  308.   char *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2)

crypto/dso/dso_lib.c:193:14: Taking false branch
191.        */
192.       if (filename != NULL)
193.           if (!DSO_set_filename(ret, filename)) {
                    ^
194.               DSOerr(DSO_F_DSO_LOAD, DSO_R_SET_FILENAME_FAILED);
195.               goto err;

crypto/dso/dso_lib.c:197:5: 
195.               goto err;
196.           }
197. >     filename = ret->filename;
198.       if (filename == NULL) {
199.           DSOerr(DSO_F_DSO_LOAD, DSO_R_NO_FILENAME);

crypto/dso/dso_lib.c:198:9: Taking false branch
196.           }
197.       filename = ret->filename;
198.       if (filename == NULL) {
               ^
199.           DSOerr(DSO_F_DSO_LOAD, DSO_R_NO_FILENAME);
200.           goto err;

crypto/dso/dso_lib.c:202:9: Taking false branch
200.           goto err;
201.       }
202.       if (ret->meth->dso_load == NULL) {
               ^
203.           DSOerr(DSO_F_DSO_LOAD, DSO_R_UNSUPPORTED);
204.           goto err;

crypto/dso/dso_lib.c:206:10: Skipping __function_pointer__(): unresolved function pointer
204.           goto err;
205.       }
206.       if (!ret->meth->dso_load(ret)) {
                ^
207.           DSOerr(DSO_F_DSO_LOAD, DSO_R_LOAD_FAILED);
208.           goto err;
