crypto/x509/by_dir.c:191: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_strndup()` at line 189, column 24 is not reachable after line 191, column 17.
Showing all 112 steps of the trace


crypto/x509/by_dir.c:149:1: start of procedure add_cert_dir()
147.   }
148.   
149. > static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
150.   {
151.       int j;

crypto/x509/by_dir.c:155:9: Taking false branch
153.       const char *s, *ss, *p;
154.   
155.       if (dir == NULL || !*dir) {
               ^
156.           X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
157.           return 0;

crypto/x509/by_dir.c:155:25: Taking false branch
153.       const char *s, *ss, *p;
154.   
155.       if (dir == NULL || !*dir) {
                               ^
156.           X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
157.           return 0;

crypto/x509/by_dir.c:160:5: 
158.       }
159.   
160. >     s = dir;
161.       p = s;
162.       do {

crypto/x509/by_dir.c:161:5: 
159.   
160.       s = dir;
161. >     p = s;
162.       do {
163.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {

crypto/x509/by_dir.c:163:14: Taking true branch
161.       p = s;
162.       do {
163.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
                    ^
164.               BY_DIR_ENTRY *ent;
165.               ss = s;

crypto/x509/by_dir.c:165:13: 
163.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
164.               BY_DIR_ENTRY *ent;
165. >             ss = s;
166.               s = p + 1;
167.               len = p - ss;

crypto/x509/by_dir.c:166:13: 
164.               BY_DIR_ENTRY *ent;
165.               ss = s;
166. >             s = p + 1;
167.               len = p - ss;
168.               if (len == 0)

crypto/x509/by_dir.c:167:13: 
165.               ss = s;
166.               s = p + 1;
167. >             len = p - ss;
168.               if (len == 0)
169.                   continue;

crypto/x509/by_dir.c:168:17: Taking false branch
166.               s = p + 1;
167.               len = p - ss;
168.               if (len == 0)
                       ^
169.                   continue;
170.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {

crypto/x509/by_dir.c:170:18: 
168.               if (len == 0)
169.                   continue;
170. >             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
171.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
172.                   if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)

crypto/x509/by_dir.c:170:25: 
168.               if (len == 0)
169.                   continue;
170. >             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
171.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
172.                   if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)

crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_num()
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141.   DEFINE_STACK_OF(BY_DIR_HASH)
  142. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  144.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:359:1: start of procedure OPENSSL_sk_num()
    357.   }
    358.   
    359. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:361:12: Condition is true
    359.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361.       return st == NULL ? -1 : st->num;
                      ^
    362.   }
    363.   

crypto/stack/stack.c:361:5: 
    359.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361. >     return st == NULL ? -1 : st->num;
    362.   }
    363.   

crypto/stack/stack.c:362:1: return from a call to OPENSSL_sk_num
    360.   {
    361.       return st == NULL ? -1 : st->num;
    362. > }
    363.   
    364.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_num
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141.   DEFINE_STACK_OF(BY_DIR_HASH)
  142. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  144.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:170:25: Loop condition is false. Leaving loop
168.               if (len == 0)
169.                   continue;
170.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
                               ^
171.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
172.                   if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)

crypto/x509/by_dir.c:175:17: 
173.                       break;
174.               }
175. >             if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
176.                   continue;
177.               if (ctx->dirs == NULL) {

crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_num()
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141.   DEFINE_STACK_OF(BY_DIR_HASH)
  142. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  144.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:359:1: start of procedure OPENSSL_sk_num()
    357.   }
    358.   
    359. > int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361.       return st == NULL ? -1 : st->num;

crypto/stack/stack.c:361:12: Condition is true
    359.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361.       return st == NULL ? -1 : st->num;
                      ^
    362.   }
    363.   

crypto/stack/stack.c:361:5: 
    359.   int OPENSSL_sk_num(const OPENSSL_STACK *st)
    360.   {
    361. >     return st == NULL ? -1 : st->num;
    362.   }
    363.   

crypto/stack/stack.c:362:1: return from a call to OPENSSL_sk_num
    360.   {
    361.       return st == NULL ? -1 : st->num;
    362. > }
    363.   
    364.   void *OPENSSL_sk_value(const OPENSSL_STACK *st, int i)

crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_num
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141.   DEFINE_STACK_OF(BY_DIR_HASH)
  142. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  144.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:175:17: Taking false branch
173.                       break;
174.               }
175.               if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
                       ^
176.                   continue;
177.               if (ctx->dirs == NULL) {

crypto/x509/by_dir.c:177:17: Taking true branch
175.               if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
176.                   continue;
177.               if (ctx->dirs == NULL) {
                       ^
178.                   ctx->dirs = sk_BY_DIR_ENTRY_new_null();
179.                   if (!ctx->dirs) {

crypto/x509/by_dir.c:178:17: 
176.                   continue;
177.               if (ctx->dirs == NULL) {
178. >                 ctx->dirs = sk_BY_DIR_ENTRY_new_null();
179.                   if (!ctx->dirs) {
180.                       X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);

crypto/x509/x509_lcl.h:142:1: start of procedure sk_BY_DIR_ENTRY_new_null()
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141.   DEFINE_STACK_OF(BY_DIR_HASH)
  142. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  144.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:112:1: start of procedure OPENSSL_sk_new_null()
    110.   }
    111.   
    112. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:114:5: 
    112.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    115.   }
    116.   

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
      216.   }
      217.   
      218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      219.   {
      220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
      218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      219.   {
      220. >     void *ret = CRYPTO_malloc(num, file, line);
      221.   
      222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
        187.   #endif
        188.   
        189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        190.   {
        191.       void *ret = NULL;

crypto/mem.c:191:5: 
        189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        190.   {
        191. >     void *ret = NULL;
        192.   
        193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
        192.   
        193.       INCREMENT(malloc_count);
        194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        195.           return malloc_impl(num, file, line);
        196.   

crypto/mem.c:197:9: Taking false branch
        195.           return malloc_impl(num, file, line);
        196.   
        197.       if (num == 0)
                       ^
        198.           return NULL;
        199.   

crypto/mem.c:201:5: 
        199.   
        200.       FAILTEST();
        201. >     allow_customize = 0;
        202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
        209.       }
        210.   #else
        211. >     (void)(file); (void)(line);
        212.       ret = malloc(num);
        213.   #endif

crypto/mem.c:211:19: 
        209.       }
        210.   #else
        211. >     (void)(file); (void)(line);
        212.       ret = malloc(num);
        213.   #endif

crypto/mem.c:212:5: 
        210.   #else
        211.       (void)(file); (void)(line);
        212. >     ret = malloc(num);
        213.   #endif
        214.   

crypto/mem.c:215:5: 
        213.   #endif
        214.   
        215. >     return ret;
        216.   }
        217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
        214.   
        215.       return ret;
        216. > }
        217.   
        218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking true branch
      221.   
      222.       FAILTEST();
      223.       if (ret != NULL)
                     ^
      224.           memset(ret, 0, num);
      225.       return ret;

crypto/mem.c:224:9: 
      222.       FAILTEST();
      223.       if (ret != NULL)
      224. >         memset(ret, 0, num);
      225.       return ret;
      226.   }

crypto/mem.c:225:5: 
      223.       if (ret != NULL)
      224.           memset(ret, 0, num);
      225. >     return ret;
      226.   }
      227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
      224.           memset(ret, 0, num);
      225.       return ret;
      226. > }
      227.   
      228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:115:1: return from a call to OPENSSL_sk_new_null
    113.   {
    114.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    115. > }
    116.   
    117.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

crypto/x509/x509_lcl.h:142:1: return from a call to sk_BY_DIR_ENTRY_new_null
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141.   DEFINE_STACK_OF(BY_DIR_HASH)
  142. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  144.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:179:22: Taking false branch
177.               if (ctx->dirs == NULL) {
178.                   ctx->dirs = sk_BY_DIR_ENTRY_new_null();
179.                   if (!ctx->dirs) {
                            ^
180.                       X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
181.                       return 0;

crypto/x509/by_dir.c:184:13: 
182.                   }
183.               }
184. >             ent = OPENSSL_malloc(sizeof(*ent));
185.               if (ent == NULL)
186.                   return 0;

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
  187.   #endif
  188.   
  189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  190.   {
  191.       void *ret = NULL;

crypto/mem.c:191:5: 
  189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  190.   {
  191. >     void *ret = NULL;
  192.   
  193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking true branch
  192.   
  193.       INCREMENT(malloc_count);
  194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  195.           return malloc_impl(num, file, line);
  196.   

crypto/mem.c:194:32: Taking true branch
  192.   
  193.       INCREMENT(malloc_count);
  194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  195.           return malloc_impl(num, file, line);
  196.   

crypto/mem.c:195:9: Skipping __function_pointer__(): unresolved function pointer
  193.       INCREMENT(malloc_count);
  194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  195.           return malloc_impl(num, file, line);
                 ^
  196.   
  197.       if (num == 0)

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
  214.   
  215.       return ret;
  216. > }
  217.   
  218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/x509/by_dir.c:185:17: Taking false branch
183.               }
184.               ent = OPENSSL_malloc(sizeof(*ent));
185.               if (ent == NULL)
                       ^
186.                   return 0;
187.               ent->dir_type = type;

crypto/x509/by_dir.c:187:13: 
185.               if (ent == NULL)
186.                   return 0;
187. >             ent->dir_type = type;
188.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
189.               ent->dir = OPENSSL_strndup(ss, len);

crypto/x509/by_dir.c:188:13: 
186.                   return 0;
187.               ent->dir_type = type;
188. >             ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
189.               ent->dir = OPENSSL_strndup(ss, len);
190.               if (ent->dir == NULL || ent->hashes == NULL) {

crypto/x509/x509_lcl.h:141:1: start of procedure sk_BY_DIR_HASH_new()
  139.   typedef struct lookup_dir_hashes_st BY_DIR_HASH;
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141. > DEFINE_STACK_OF(BY_DIR_HASH)
  142.   DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;

crypto/x509/x509_lcl.h:141:1: return from a call to sk_BY_DIR_HASH_new
  139.   typedef struct lookup_dir_hashes_st BY_DIR_HASH;
  140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  141. > DEFINE_STACK_OF(BY_DIR_HASH)
  142.   DEFINE_STACK_OF(BY_DIR_ENTRY)
  143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;

crypto/x509/by_dir.c:189:13: 
187.               ent->dir_type = type;
188.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
189. >             ent->dir = OPENSSL_strndup(ss, len);
190.               if (ent->dir == NULL || ent->hashes == NULL) {
191.                   by_dir_entry_free(ent);

crypto/o_str.c:39:1: start of procedure CRYPTO_strndup()
  37.   }
  38.   
  39. > char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)
  40.   {
  41.       size_t maxlen;

crypto/o_str.c:44:9: Taking false branch
  42.       char *ret;
  43.   
  44.       if (str == NULL)
                ^
  45.           return NULL;
  46.   

crypto/o_str.c:47:5: 
  45.           return NULL;
  46.   
  47. >     maxlen = OPENSSL_strnlen(str, s);
  48.   
  49.       ret = CRYPTO_malloc(maxlen + 1, file, line);

crypto/o_str.c:72:1: start of procedure OPENSSL_strnlen()
    70.   }
    71.   
    72. > size_t OPENSSL_strnlen(const char *str, size_t maxlen)
    73.   {
    74.       const char *p;

crypto/o_str.c:76:10: 
    74.       const char *p;
    75.   
    76. >     for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
    77.   
    78.       return p - str;

crypto/o_str.c:76:19: Loop condition is true. Entering loop body
    74.       const char *p;
    75.   
    76.       for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
                            ^
    77.   
    78.       return p - str;

crypto/o_str.c:76:36: Loop condition is true. Entering loop body
    74.       const char *p;
    75.   
    76.       for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
                                             ^
    77.   
    78.       return p - str;

crypto/o_str.c:76:48: 
    74.       const char *p;
    75.   
    76. >     for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
    77.   
    78.       return p - str;

crypto/o_str.c:76:19: Loop condition is true. Entering loop body
    74.       const char *p;
    75.   
    76.       for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
                            ^
    77.   
    78.       return p - str;

crypto/o_str.c:76:36: Loop condition is false. Leaving loop
    74.       const char *p;
    75.   
    76.       for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
                                             ^
    77.   
    78.       return p - str;

crypto/o_str.c:78:5: 
    76.       for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
    77.   
    78. >     return p - str;
    79.   }
    80.   

crypto/o_str.c:79:1: return from a call to OPENSSL_strnlen
    77.   
    78.       return p - str;
    79. > }
    80.   
    81.   size_t OPENSSL_strlcpy(char *dst, const char *src, size_t size)

crypto/o_str.c:49:5: 
  47.       maxlen = OPENSSL_strnlen(str, s);
  48.   
  49. >     ret = CRYPTO_malloc(maxlen + 1, file, line);
  50.       if (ret) {
  51.           memcpy(ret, str, maxlen);

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
    187.   #endif
    188.   
    189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191.       void *ret = NULL;

crypto/mem.c:191:5: 
    189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191. >     void *ret = NULL;
    192.   
    193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
    192.   
    193.       INCREMENT(malloc_count);
    194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    195.           return malloc_impl(num, file, line);
    196.   

crypto/mem.c:197:9: Taking false branch
    195.           return malloc_impl(num, file, line);
    196.   
    197.       if (num == 0)
                   ^
    198.           return NULL;
    199.   

crypto/mem.c:201:5: 
    199.   
    200.       FAILTEST();
    201. >     allow_customize = 0;
    202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
    209.       }
    210.   #else
    211. >     (void)(file); (void)(line);
    212.       ret = malloc(num);
    213.   #endif

crypto/mem.c:211:19: 
    209.       }
    210.   #else
    211. >     (void)(file); (void)(line);
    212.       ret = malloc(num);
    213.   #endif

crypto/mem.c:212:5: 
    210.   #else
    211.       (void)(file); (void)(line);
    212. >     ret = malloc(num);
    213.   #endif
    214.   

crypto/mem.c:215:5: 
    213.   #endif
    214.   
    215. >     return ret;
    216.   }
    217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
    214.   
    215.       return ret;
    216. > }
    217.   
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/o_str.c:50:9: Taking true branch
  48.   
  49.       ret = CRYPTO_malloc(maxlen + 1, file, line);
  50.       if (ret) {
                ^
  51.           memcpy(ret, str, maxlen);
  52.           ret[maxlen] = '\0';

crypto/o_str.c:51:9: 
  49.       ret = CRYPTO_malloc(maxlen + 1, file, line);
  50.       if (ret) {
  51. >         memcpy(ret, str, maxlen);
  52.           ret[maxlen] = '\0';
  53.       }

crypto/o_str.c:52:9: 
  50.       if (ret) {
  51.           memcpy(ret, str, maxlen);
  52. >         ret[maxlen] = '\0';
  53.       }
  54.       return ret;

crypto/o_str.c:54:5: 
  52.           ret[maxlen] = '\0';
  53.       }
  54. >     return ret;
  55.   }
  56.   

crypto/o_str.c:55:1: return from a call to CRYPTO_strndup
  53.       }
  54.       return ret;
  55. > }
  56.   
  57.   void *CRYPTO_memdup(const void *data, size_t siz, const char* file, int line)

crypto/x509/by_dir.c:190:17: Taking false branch
188.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
189.               ent->dir = OPENSSL_strndup(ss, len);
190.               if (ent->dir == NULL || ent->hashes == NULL) {
                       ^
191.                   by_dir_entry_free(ent);
192.                   return 0;

crypto/x509/by_dir.c:190:37: Taking true branch
188.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
189.               ent->dir = OPENSSL_strndup(ss, len);
190.               if (ent->dir == NULL || ent->hashes == NULL) {
                                           ^
191.                   by_dir_entry_free(ent);
192.                   return 0;

crypto/x509/by_dir.c:191:17: 
189.               ent->dir = OPENSSL_strndup(ss, len);
190.               if (ent->dir == NULL || ent->hashes == NULL) {
191. >                 by_dir_entry_free(ent);
192.                   return 0;
193.               }

crypto/x509/by_dir.c:131:1: start of procedure by_dir_entry_free()
  129.   }
  130.   
  131. > static void by_dir_entry_free(BY_DIR_ENTRY *ent)
  132.   {
  133.       OPENSSL_free(ent->dir);

crypto/x509/by_dir.c:133:5: 
  131.   static void by_dir_entry_free(BY_DIR_ENTRY *ent)
  132.   {
  133. >     OPENSSL_free(ent->dir);
  134.       sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
  135.       OPENSSL_free(ent);

crypto/mem.c:286:1: start of procedure CRYPTO_free()
    284.   }
    285.   
    286. > void CRYPTO_free(void *str, const char *file, int line)
    287.   {
    288.       INCREMENT(free_count);

crypto/mem.c:289:9: Taking true branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:289:30: Taking true branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:290:9: Skipping __function_pointer__(): unresolved function pointer
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    290.           free_impl(str, file, line);
                   ^
    291.           return;
    292.       }

crypto/mem.c:291:9: 
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    290.           free_impl(str, file, line);
    291. >         return;
    292.       }
    293.   

crypto/mem.c:305:1: return from a call to CRYPTO_free
    303.       free(str);
    304.   #endif
    305. > }
    306.   
    307.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/by_dir.c:134:5: 
  132.   {
  133.       OPENSSL_free(ent->dir);
  134. >     sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
  135.       OPENSSL_free(ent);
  136.   }

crypto/x509/x509_lcl.h:141:1: start of procedure sk_BY_DIR_HASH_pop_free()
    139.   typedef struct lookup_dir_hashes_st BY_DIR_HASH;
    140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
    141. > DEFINE_STACK_OF(BY_DIR_HASH)
    142.   DEFINE_STACK_OF(BY_DIR_ENTRY)
    143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;

crypto/x509/x509_lcl.h:141:1: return from a call to sk_BY_DIR_HASH_pop_free
    139.   typedef struct lookup_dir_hashes_st BY_DIR_HASH;
    140.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
    141. > DEFINE_STACK_OF(BY_DIR_HASH)
    142.   DEFINE_STACK_OF(BY_DIR_ENTRY)
    143.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;

crypto/x509/by_dir.c:135:5: 
  133.       OPENSSL_free(ent->dir);
  134.       sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
  135. >     OPENSSL_free(ent);
  136.   }
  137.   

crypto/mem.c:286:1: start of procedure CRYPTO_free()
    284.   }
    285.   
    286. > void CRYPTO_free(void *str, const char *file, int line)
    287.   {
    288.       INCREMENT(free_count);

crypto/mem.c:289:9: Taking false branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:303:5: 
    301.       }
    302.   #else
    303. >     free(str);
    304.   #endif
    305.   }

crypto/mem.c:305:1: return from a call to CRYPTO_free
    303.       free(str);
    304.   #endif
    305. > }
    306.   
    307.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/by_dir.c:136:1: return from a call to by_dir_entry_free
  134.       sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);
  135.       OPENSSL_free(ent);
  136. > }
  137.   
  138.   static void free_dir(X509_LOOKUP *lu)

static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
{
    int j;
    size_t len;
    const char *s, *ss, *p;
    if (dir == NULL || !*dir) {
        X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
        return 0;
    }
    s = dir;
    p = s;
    do {
        if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
            BY_DIR_ENTRY *ent;
            ss = s;
            s = p + 1;
            len = p - ss;
            if (len == 0)
                continue;
            for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
                ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
                if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)
                    break;
            }
            if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
                continue;
            if (ctx->dirs == NULL) {
                ctx->dirs = sk_BY_DIR_ENTRY_new_null();
                if (!ctx->dirs) {
                    X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
                    return 0;
                }
            }
            ent = OPENSSL_malloc(sizeof(*ent));
            if (ent == NULL)
                return 0;
            ent->dir_type = type;
            ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
            ent->dir = OPENSSL_strndup(ss, len);
            if (ent->dir == NULL || ent->hashes == NULL) {
                by_dir_entry_free(ent);
                return 0;
            }
            if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
                by_dir_entry_free(ent);
                return 0;
            }
        }
    } while (*p++ != '\0');
    return 1;
}
["static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)\n{\n    int j;\n    size_t len;\n    const char *s, *ss, *p;\n    if (dir == NULL || !*dir) {\n        X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);\n        return 0;\n    }\n    s = dir;\n    p = s;\n    do {\n        if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\\0')) {\n            BY_DIR_ENTRY *ent;\n            ss = s;\n            s = p + 1;\n            len = p - ss;\n            if (len == 0)\n                continue;\n            for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {\n                ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);\n                if (strlen(ent->dir) == len && strncmp(ent->dir, ss, len) == 0)\n                    break;\n            }\n            if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))\n                continue;\n            if (ctx->dirs == NULL) {\n                ctx->dirs = sk_BY_DIR_ENTRY_new_null();\n                if (!ctx->dirs) {\n                    X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);\n                    return 0;\n                }\n            }\n            ent = OPENSSL_malloc(sizeof(*ent));\n            if (ent == NULL)\n                return 0;\n            ent->dir_type = type;\n            ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);\n            ent->dir = OPENSSL_strndup(ss, len);\n            if (ent->dir == NULL || ent->hashes == NULL) {\n                by_dir_entry_free(ent);\n                return 0;\n            }\n            if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {\n                by_dir_entry_free(ent);\n                return 0;\n            }\n        }\n    } while (*p++ != '\\0');\n    return 1;\n}", 'int OPENSSL_sk_num(const OPENSSL_STACK *st)\n{\n    return st == NULL ? -1 : st->num;\n}', 'OPENSSL_STACK *OPENSSL_sk_new_null(void)\n{\n    return OPENSSL_zalloc(sizeof(OPENSSL_STACK));\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    FAILTEST();\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    INCREMENT(malloc_count);\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)(file); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', "char *CRYPTO_strndup(const char *str, size_t s, const char* file, int line)\n{\n    size_t maxlen;\n    char *ret;\n    if (str == NULL)\n        return NULL;\n    maxlen = OPENSSL_strnlen(str, s);\n    ret = CRYPTO_malloc(maxlen + 1, file, line);\n    if (ret) {\n        memcpy(ret, str, maxlen);\n        ret[maxlen] = '\\0';\n    }\n    return ret;\n}", "size_t OPENSSL_strnlen(const char *str, size_t maxlen)\n{\n    const char *p;\n    for (p = str; maxlen-- != 0 && *p != '\\0'; ++p) ;\n    return p - str;\n}", 'static void by_dir_entry_free(BY_DIR_ENTRY *ent)\n{\n    OPENSSL_free(ent->dir);\n    sk_BY_DIR_HASH_pop_free(ent->hashes, by_dir_hash_free);\n    OPENSSL_free(ent);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    INCREMENT(free_count);\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']