crypto/x509/by_dir.c:215: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 229, column 19 is not reachable after line 215, column 23.
Showing all 183 steps of the trace


crypto/x509/by_dir.c:194:1: start of procedure add_cert_dir()
192.   }
193.   
194. > static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
195.   {
196.       int j, len;

crypto/x509/by_dir.c:199:9: Taking false branch
197.       const char *s, *ss, *p;
198.   
199.       if (dir == NULL || !*dir) {
               ^
200.           X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
201.           return 0;

crypto/x509/by_dir.c:199:25: Taking false branch
197.       const char *s, *ss, *p;
198.   
199.       if (dir == NULL || !*dir) {
                               ^
200.           X509err(X509_F_ADD_CERT_DIR, X509_R_INVALID_DIRECTORY);
201.           return 0;

crypto/x509/by_dir.c:204:5: 
202.       }
203.   
204. >     s = dir;
205.       p = s;
206.       do {

crypto/x509/by_dir.c:205:5: 
203.   
204.       s = dir;
205. >     p = s;
206.       do {
207.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {

crypto/x509/by_dir.c:207:14: Taking true branch
205.       p = s;
206.       do {
207.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
                    ^
208.               BY_DIR_ENTRY *ent;
209.               ss = s;

crypto/x509/by_dir.c:209:13: 
207.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
208.               BY_DIR_ENTRY *ent;
209. >             ss = s;
210.               s = p + 1;
211.               len = (int)(p - ss);

crypto/x509/by_dir.c:210:13: 
208.               BY_DIR_ENTRY *ent;
209.               ss = s;
210. >             s = p + 1;
211.               len = (int)(p - ss);
212.               if (len == 0)

crypto/x509/by_dir.c:211:13: 
209.               ss = s;
210.               s = p + 1;
211. >             len = (int)(p - ss);
212.               if (len == 0)
213.                   continue;

crypto/x509/by_dir.c:212:17: Taking false branch
210.               s = p + 1;
211.               len = (int)(p - ss);
212.               if (len == 0)
                       ^
213.                   continue;
214.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {

crypto/x509/by_dir.c:214:18: 
212.               if (len == 0)
213.                   continue;
214. >             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
215.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&

crypto/x509/by_dir.c:214:25: 
212.               if (len == 0)
213.                   continue;
214. >             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
215.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&

crypto/x509/x509_lcl.h:120:1: start of procedure sk_BY_DIR_ENTRY_num()
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking true branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:320:9: 
    318.   {
    319.       if (st == NULL)
    320. >         return -1;
    321.       return st->num;
    322.   }

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_lcl.h:120:1: return from a call to sk_BY_DIR_ENTRY_num
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:214:25: Loop condition is false. Leaving loop
212.               if (len == 0)
213.                   continue;
214.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
                               ^
215.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&

crypto/x509/by_dir.c:220:17: 
218.                       break;
219.               }
220. >             if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
221.                   continue;
222.               if (ctx->dirs == NULL) {

crypto/x509/x509_lcl.h:120:1: start of procedure sk_BY_DIR_ENTRY_num()
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking true branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:320:9: 
    318.   {
    319.       if (st == NULL)
    320. >         return -1;
    321.       return st->num;
    322.   }

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_lcl.h:120:1: return from a call to sk_BY_DIR_ENTRY_num
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:220:17: Taking false branch
218.                       break;
219.               }
220.               if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
                       ^
221.                   continue;
222.               if (ctx->dirs == NULL) {

crypto/x509/by_dir.c:222:17: Taking true branch
220.               if (j < sk_BY_DIR_ENTRY_num(ctx->dirs))
221.                   continue;
222.               if (ctx->dirs == NULL) {
                       ^
223.                   ctx->dirs = sk_BY_DIR_ENTRY_new_null();
224.                   if (!ctx->dirs) {

crypto/x509/by_dir.c:223:17: 
221.                   continue;
222.               if (ctx->dirs == NULL) {
223. >                 ctx->dirs = sk_BY_DIR_ENTRY_new_null();
224.                   if (!ctx->dirs) {
225.                       X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);

crypto/x509/x509_lcl.h:120:1: start of procedure sk_BY_DIR_ENTRY_new_null()
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:145:1: start of procedure sk_new_null()
    143.   }
    144.   
    145. > _STACK *sk_new_null(void)
    146.   {
    147.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:147:5: 
    145.   _STACK *sk_new_null(void)
    146.   {
    147. >     return sk_new((int (*)(const void *, const void *))0);
    148.   }
    149.   

crypto/stack/stack.c:150:1: start of procedure sk_new()
      148.   }
      149.   
      150. > _STACK *sk_new(int (*c) (const void *, const void *))
      151.   {
      152.       _STACK *ret;

crypto/stack/stack.c:154:9: 
      152.       _STACK *ret;
      153.   
      154. >     if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      155.           goto err;
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

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

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

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

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

crypto/mem.c:124:9: Taking false branch
          122.       void *ret = NULL;
          123.   
          124.       if (num <= 0)
                         ^
          125.           return NULL;
          126.   

crypto/mem.c:127:5: 
          125.           return NULL;
          126.   
          127. >     allow_customize = 0;
          128.   #ifdef CRYPTO_MDEBUG
          129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
          135.       }
          136.   #else
          137. >     (void)file;
          138.       (void)line;
          139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
          152.   #endif
          153.   
          154. >     return ret;
          155.   }
          156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
          153.   
          154.       return ret;
          155. > }
          156.   
          157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:162:9: 
        160.   
        161.       if (ret != NULL)
        162. >         memset(ret, 0, num);
        163.       return ret;
        164.   }

crypto/mem.c:163:5: 
        161.       if (ret != NULL)
        162.           memset(ret, 0, num);
        163. >     return ret;
        164.   }
        165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
        162.           memset(ret, 0, num);
        163.       return ret;
        164. > }
        165.   
        166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:154:9: Taking false branch
      152.       _STACK *ret;
      153.   
      154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
                     ^
      155.           goto err;
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/stack/stack.c:156:9: 
      154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      155.           goto err;
      156. >     if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
      157.           goto err;
      158.       ret->comp = c;

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

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

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

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

crypto/mem.c:124:9: Taking false branch
          122.       void *ret = NULL;
          123.   
          124.       if (num <= 0)
                         ^
          125.           return NULL;
          126.   

crypto/mem.c:127:5: 
          125.           return NULL;
          126.   
          127. >     allow_customize = 0;
          128.   #ifdef CRYPTO_MDEBUG
          129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
          135.       }
          136.   #else
          137. >     (void)file;
          138.       (void)line;
          139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
          152.   #endif
          153.   
          154. >     return ret;
          155.   }
          156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
          153.   
          154.       return ret;
          155. > }
          156.   
          157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:162:9: 
        160.   
        161.       if (ret != NULL)
        162. >         memset(ret, 0, num);
        163.       return ret;
        164.   }

crypto/mem.c:163:5: 
        161.       if (ret != NULL)
        162.           memset(ret, 0, num);
        163. >     return ret;
        164.   }
        165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
        162.           memset(ret, 0, num);
        163.       return ret;
        164. > }
        165.   
        166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:156:9: Taking false branch
      154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
      155.           goto err;
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
                     ^
      157.           goto err;
      158.       ret->comp = c;

crypto/stack/stack.c:158:5: 
      156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
      157.           goto err;
      158. >     ret->comp = c;
      159.       ret->num_alloc = MIN_NODES;
      160.       return (ret);

crypto/stack/stack.c:159:5: 
      157.           goto err;
      158.       ret->comp = c;
      159. >     ret->num_alloc = MIN_NODES;
      160.       return (ret);
      161.   

crypto/stack/stack.c:160:5: 
      158.       ret->comp = c;
      159.       ret->num_alloc = MIN_NODES;
      160. >     return (ret);
      161.   
      162.    err:

crypto/stack/stack.c:165:1: return from a call to sk_new
      163.       OPENSSL_free(ret);
      164.       return (NULL);
      165. > }
      166.   
      167.   int sk_insert(_STACK *st, void *data, int loc)

crypto/stack/stack.c:148:1: return from a call to sk_new_null
    146.   {
    147.       return sk_new((int (*)(const void *, const void *))0);
    148. > }
    149.   
    150.   _STACK *sk_new(int (*c) (const void *, const void *))

crypto/x509/x509_lcl.h:120:1: return from a call to sk_BY_DIR_ENTRY_new_null
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:224:22: Taking false branch
222.               if (ctx->dirs == NULL) {
223.                   ctx->dirs = sk_BY_DIR_ENTRY_new_null();
224.                   if (!ctx->dirs) {
                            ^
225.                       X509err(X509_F_ADD_CERT_DIR, ERR_R_MALLOC_FAILURE);
226.                       return 0;

crypto/x509/by_dir.c:229:13: 
227.                   }
228.               }
229. >             ent = OPENSSL_malloc(sizeof(*ent));
230.               if (ent == NULL)
231.                   return 0;

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

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

crypto/mem.c:124:9: Taking false branch
  122.       void *ret = NULL;
  123.   
  124.       if (num <= 0)
                 ^
  125.           return NULL;
  126.   

crypto/mem.c:127:5: 
  125.           return NULL;
  126.   
  127. >     allow_customize = 0;
  128.   #ifdef CRYPTO_MDEBUG
  129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
  135.       }
  136.   #else
  137. >     (void)file;
  138.       (void)line;
  139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
  152.   #endif
  153.   
  154. >     return ret;
  155.   }
  156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
  153.   
  154.       return ret;
  155. > }
  156.   
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/x509/by_dir.c:230:17: Taking false branch
228.               }
229.               ent = OPENSSL_malloc(sizeof(*ent));
230.               if (ent == NULL)
                       ^
231.                   return 0;
232.               ent->dir_type = type;

crypto/x509/by_dir.c:232:13: 
230.               if (ent == NULL)
231.                   return 0;
232. >             ent->dir_type = type;
233.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
234.               ent->dir = OPENSSL_malloc((unsigned int)len + 1);

crypto/x509/by_dir.c:233:13: 
231.                   return 0;
232.               ent->dir_type = type;
233. >             ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
234.               ent->dir = OPENSSL_malloc((unsigned int)len + 1);
235.               if (ent->dir == NULL || ent->hashes == NULL) {

crypto/x509/x509_lcl.h:119:1: start of procedure sk_BY_DIR_HASH_new()
  117.   typedef struct lookup_dir_hashes_st BY_DIR_HASH;
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119. > DEFINE_STACK_OF(BY_DIR_HASH)
  120.   DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;

crypto/stack/stack.c:150:1: start of procedure sk_new()
    148.   }
    149.   
    150. > _STACK *sk_new(int (*c) (const void *, const void *))
    151.   {
    152.       _STACK *ret;

crypto/stack/stack.c:154:9: 
    152.       _STACK *ret;
    153.   
    154. >     if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
    155.           goto err;
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

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

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

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

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

crypto/mem.c:124:9: Taking false branch
        122.       void *ret = NULL;
        123.   
        124.       if (num <= 0)
                       ^
        125.           return NULL;
        126.   

crypto/mem.c:127:5: 
        125.           return NULL;
        126.   
        127. >     allow_customize = 0;
        128.   #ifdef CRYPTO_MDEBUG
        129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
        135.       }
        136.   #else
        137. >     (void)file;
        138.       (void)line;
        139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
        152.   #endif
        153.   
        154. >     return ret;
        155.   }
        156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
        153.   
        154.       return ret;
        155. > }
        156.   
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:162:9: 
      160.   
      161.       if (ret != NULL)
      162. >         memset(ret, 0, num);
      163.       return ret;
      164.   }

crypto/mem.c:163:5: 
      161.       if (ret != NULL)
      162.           memset(ret, 0, num);
      163. >     return ret;
      164.   }
      165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
      162.           memset(ret, 0, num);
      163.       return ret;
      164. > }
      165.   
      166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:154:9: Taking false branch
    152.       _STACK *ret;
    153.   
    154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
                   ^
    155.           goto err;
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)

crypto/stack/stack.c:156:9: 
    154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
    155.           goto err;
    156. >     if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
    157.           goto err;
    158.       ret->comp = c;

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

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

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

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

crypto/mem.c:124:9: Taking false branch
        122.       void *ret = NULL;
        123.   
        124.       if (num <= 0)
                       ^
        125.           return NULL;
        126.   

crypto/mem.c:127:5: 
        125.           return NULL;
        126.   
        127. >     allow_customize = 0;
        128.   #ifdef CRYPTO_MDEBUG
        129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
        135.       }
        136.   #else
        137. >     (void)file;
        138.       (void)line;
        139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
        152.   #endif
        153.   
        154. >     return ret;
        155.   }
        156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
        153.   
        154.       return ret;
        155. > }
        156.   
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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

crypto/mem.c:162:9: 
      160.   
      161.       if (ret != NULL)
      162. >         memset(ret, 0, num);
      163.       return ret;
      164.   }

crypto/mem.c:163:5: 
      161.       if (ret != NULL)
      162.           memset(ret, 0, num);
      163. >     return ret;
      164.   }
      165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
      162.           memset(ret, 0, num);
      163.       return ret;
      164. > }
      165.   
      166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:156:9: Taking false branch
    154.       if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
    155.           goto err;
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
                   ^
    157.           goto err;
    158.       ret->comp = c;

crypto/stack/stack.c:158:5: 
    156.       if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
    157.           goto err;
    158. >     ret->comp = c;
    159.       ret->num_alloc = MIN_NODES;
    160.       return (ret);

crypto/stack/stack.c:159:5: 
    157.           goto err;
    158.       ret->comp = c;
    159. >     ret->num_alloc = MIN_NODES;
    160.       return (ret);
    161.   

crypto/stack/stack.c:160:5: 
    158.       ret->comp = c;
    159.       ret->num_alloc = MIN_NODES;
    160. >     return (ret);
    161.   
    162.    err:

crypto/stack/stack.c:165:1: return from a call to sk_new
    163.       OPENSSL_free(ret);
    164.       return (NULL);
    165. > }
    166.   
    167.   int sk_insert(_STACK *st, void *data, int loc)

crypto/x509/x509_lcl.h:119:1: return from a call to sk_BY_DIR_HASH_new
  117.   typedef struct lookup_dir_hashes_st BY_DIR_HASH;
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119. > DEFINE_STACK_OF(BY_DIR_HASH)
  120.   DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;

crypto/x509/by_dir.c:234:13: 
232.               ent->dir_type = type;
233.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
234. >             ent->dir = OPENSSL_malloc((unsigned int)len + 1);
235.               if (ent->dir == NULL || ent->hashes == NULL) {
236.                   by_dir_entry_free(ent);

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

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

crypto/mem.c:124:9: Taking false branch
  122.       void *ret = NULL;
  123.   
  124.       if (num <= 0)
                 ^
  125.           return NULL;
  126.   

crypto/mem.c:127:5: 
  125.           return NULL;
  126.   
  127. >     allow_customize = 0;
  128.   #ifdef CRYPTO_MDEBUG
  129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
  135.       }
  136.   #else
  137. >     (void)file;
  138.       (void)line;
  139.       ret = malloc(num);

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

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

crypto/mem.c:154:5: 
  152.   #endif
  153.   
  154. >     return ret;
  155.   }
  156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
  153.   
  154.       return ret;
  155. > }
  156.   
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/x509/by_dir.c:235:17: Taking false branch
233.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
234.               ent->dir = OPENSSL_malloc((unsigned int)len + 1);
235.               if (ent->dir == NULL || ent->hashes == NULL) {
                       ^
236.                   by_dir_entry_free(ent);
237.                   return 0;

crypto/x509/by_dir.c:235:37: Taking false branch
233.               ent->hashes = sk_BY_DIR_HASH_new(by_dir_hash_cmp);
234.               ent->dir = OPENSSL_malloc((unsigned int)len + 1);
235.               if (ent->dir == NULL || ent->hashes == NULL) {
                                           ^
236.                   by_dir_entry_free(ent);
237.                   return 0;

crypto/x509/by_dir.c:239:13: 
237.                   return 0;
238.               }
239. >             strncpy(ent->dir, ss, (unsigned int)len);
240.               ent->dir[len] = '\0';
241.               if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {

crypto/x509/by_dir.c:240:13: 
238.               }
239.               strncpy(ent->dir, ss, (unsigned int)len);
240. >             ent->dir[len] = '\0';
241.               if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
242.                   by_dir_entry_free(ent);

crypto/x509/by_dir.c:241:18: 
239.               strncpy(ent->dir, ss, (unsigned int)len);
240.               ent->dir[len] = '\0';
241. >             if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
242.                   by_dir_entry_free(ent);
243.                   return 0;

crypto/x509/x509_lcl.h:120:1: start of procedure sk_BY_DIR_ENTRY_push()
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:259:1: start of procedure sk_push()
    257.   }
    258.   
    259. > int sk_push(_STACK *st, void *data)
    260.   {
    261.       return (sk_insert(st, data, st->num));

crypto/stack/stack.c:261:5: 
    259.   int sk_push(_STACK *st, void *data)
    260.   {
    261. >     return (sk_insert(st, data, st->num));
    262.   }
    263.   

crypto/stack/stack.c:167:1: start of procedure sk_insert()
      165.   }
      166.   
      167. > int sk_insert(_STACK *st, void *data, int loc)
      168.   {
      169.       char **s;

crypto/stack/stack.c:171:9: Taking false branch
      169.       char **s;
      170.   
      171.       if (st == NULL)
                     ^
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {

crypto/stack/stack.c:173:9: Taking false branch
      171.       if (st == NULL)
      172.           return 0;
      173.       if (st->num_alloc <= st->num + 1) {
                     ^
      174.           s = OPENSSL_realloc((char *)st->data,
      175.                               (unsigned int)sizeof(char *) * st->num_alloc * 2);

crypto/stack/stack.c:181:10: Taking true branch
      179.           st->num_alloc *= 2;
      180.       }
      181.       if ((loc >= (int)st->num) || (loc < 0))
                      ^
      182.           st->data[st->num] = data;
      183.       else {

crypto/stack/stack.c:182:9: 
      180.       }
      181.       if ((loc >= (int)st->num) || (loc < 0))
      182. >         st->data[st->num] = data;
      183.       else {
      184.           memmove(&(st->data[loc + 1]),

crypto/stack/stack.c:188:5: 
      186.           st->data[loc] = data;
      187.       }
      188. >     st->num++;
      189.       st->sorted = 0;
      190.       return (st->num);

crypto/stack/stack.c:189:5: 
      187.       }
      188.       st->num++;
      189. >     st->sorted = 0;
      190.       return (st->num);
      191.   }

crypto/stack/stack.c:190:5: 
      188.       st->num++;
      189.       st->sorted = 0;
      190. >     return (st->num);
      191.   }
      192.   

crypto/stack/stack.c:191:1: return from a call to sk_insert
      189.       st->sorted = 0;
      190.       return (st->num);
      191. > }
      192.   
      193.   void *sk_delete_ptr(_STACK *st, void *p)

crypto/stack/stack.c:262:1: return from a call to sk_push
    260.   {
    261.       return (sk_insert(st, data, st->num));
    262. > }
    263.   
    264.   int sk_unshift(_STACK *st, void *data)

crypto/x509/x509_lcl.h:120:1: return from a call to sk_BY_DIR_ENTRY_push
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:241:18: Taking false branch
239.               strncpy(ent->dir, ss, (unsigned int)len);
240.               ent->dir[len] = '\0';
241.               if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) {
                        ^
242.                   by_dir_entry_free(ent);
243.                   return 0;

crypto/x509/by_dir.c:246:14: Loop condition is true. Entering loop body
244.               }
245.           }
246.       } while (*p++ != '\0');
                    ^
247.       return 1;
248.   }

crypto/x509/by_dir.c:207:14: Taking false branch
205.       p = s;
206.       do {
207.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
                    ^
208.               BY_DIR_ENTRY *ent;
209.               ss = s;

crypto/x509/by_dir.c:207:45: Taking true branch
205.       p = s;
206.       do {
207.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
                                                   ^
208.               BY_DIR_ENTRY *ent;
209.               ss = s;

crypto/x509/by_dir.c:209:13: 
207.           if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) {
208.               BY_DIR_ENTRY *ent;
209. >             ss = s;
210.               s = p + 1;
211.               len = (int)(p - ss);

crypto/x509/by_dir.c:210:13: 
208.               BY_DIR_ENTRY *ent;
209.               ss = s;
210. >             s = p + 1;
211.               len = (int)(p - ss);
212.               if (len == 0)

crypto/x509/by_dir.c:211:13: 
209.               ss = s;
210.               s = p + 1;
211. >             len = (int)(p - ss);
212.               if (len == 0)
213.                   continue;

crypto/x509/by_dir.c:212:17: Taking false branch
210.               s = p + 1;
211.               len = (int)(p - ss);
212.               if (len == 0)
                       ^
213.                   continue;
214.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {

crypto/x509/by_dir.c:214:18: 
212.               if (len == 0)
213.                   continue;
214. >             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
215.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&

crypto/x509/by_dir.c:214:25: 
212.               if (len == 0)
213.                   continue;
214. >             for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
215.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&

crypto/x509/x509_lcl.h:120:1: start of procedure sk_BY_DIR_ENTRY_num()
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:317:1: start of procedure sk_num()
    315.   }
    316.   
    317. > int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)

crypto/stack/stack.c:319:9: Taking false branch
    317.   int sk_num(const _STACK *st)
    318.   {
    319.       if (st == NULL)
                   ^
    320.           return -1;
    321.       return st->num;

crypto/stack/stack.c:321:5: 
    319.       if (st == NULL)
    320.           return -1;
    321. >     return st->num;
    322.   }
    323.   

crypto/stack/stack.c:322:1: return from a call to sk_num
    320.           return -1;
    321.       return st->num;
    322. > }
    323.   
    324.   void *sk_value(const _STACK *st, int i)

crypto/x509/x509_lcl.h:120:1: return from a call to sk_BY_DIR_ENTRY_num
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/x509/by_dir.c:214:25: Loop condition is true. Entering loop body
212.               if (len == 0)
213.                   continue;
214.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
                               ^
215.                   ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&

crypto/x509/by_dir.c:215:17: 
213.                   continue;
214.               for (j = 0; j < sk_BY_DIR_ENTRY_num(ctx->dirs); j++) {
215. >                 ent = sk_BY_DIR_ENTRY_value(ctx->dirs, j);
216.                   if (strlen(ent->dir) == (size_t)len &&
217.                       strncmp(ent->dir, ss, (unsigned int)len) == 0)

crypto/x509/x509_lcl.h:120:1: start of procedure sk_BY_DIR_ENTRY_value()
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)

crypto/stack/stack.c:324:1: start of procedure sk_value()
    322.   }
    323.   
    324. > void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))

crypto/stack/stack.c:326:10: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                    ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:17: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                           ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:326:28: Taking false branch
    324.   void *sk_value(const _STACK *st, int i)
    325.   {
    326.       if (!st || (i < 0) || (i >= st->num))
                                      ^
    327.           return NULL;
    328.       return st->data[i];

crypto/stack/stack.c:328:5: 
    326.       if (!st || (i < 0) || (i >= st->num))
    327.           return NULL;
    328. >     return st->data[i];
    329.   }
    330.   

crypto/stack/stack.c:329:1: return from a call to sk_value
    327.           return NULL;
    328.       return st->data[i];
    329. > }
    330.   
    331.   void *sk_set(_STACK *st, int i, void *value)

crypto/x509/x509_lcl.h:120:1: return from a call to sk_BY_DIR_ENTRY_value
  118.   typedef struct lookup_dir_entry_st BY_DIR_ENTRY;
  119.   DEFINE_STACK_OF(BY_DIR_HASH)
  120. > DEFINE_STACK_OF(BY_DIR_ENTRY)
  121.   typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
  122.   DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)
