apps/srp.c:156: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `app_malloc()` at line 143, column 12 is not reachable after line 156, column 5.
Showing all 25 steps of the trace


apps/srp.c:138:1: start of procedure update_index()
136.   }
137.   
138. > static int update_index(CA_DB *db, char **row)
139.   {
140.       char **irow;

apps/srp.c:143:5: 
141.       int i;
142.   
143. >     irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
144.       for (i = 0; i < DB_NUMBER; i++) {
145.           irow[i] = row[i];

apps/apps.c:991:1: start of procedure app_malloc()
  989.   }
  990.   
  991. > void* app_malloc(int sz, const char *what)
  992.   {
  993.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:993:5: 
  991.   void* app_malloc(int sz, const char *what)
  992.   {
  993. >     void *vp = OPENSSL_malloc(sz);
  994.   
  995.       if (vp == NULL) {

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 (num <= 0)

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

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

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

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

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

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

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

apps/apps.c:995:9: Taking false branch
  993.       void *vp = OPENSSL_malloc(sz);
  994.   
  995.       if (vp == NULL) {
                 ^
  996.           BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
  997.                   opt_getprog(), sz, what);

apps/apps.c:1001:5: 
  999.           exit(1);
  1000.       }
  1001. >     return vp;
  1002.   }
  1003.   

apps/apps.c:1002:1: return from a call to app_malloc
  1000.       }
  1001.       return vp;
  1002. > }
  1003.   
  1004.   /*

apps/srp.c:144:10: 
142.   
143.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
144. >     for (i = 0; i < DB_NUMBER; i++) {
145.           irow[i] = row[i];
146.           row[i] = NULL;

apps/srp.c:144:17: Loop condition is true. Entering loop body
142.   
143.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
144.       for (i = 0; i < DB_NUMBER; i++) {
                       ^
145.           irow[i] = row[i];
146.           row[i] = NULL;

apps/srp.c:145:9: 
143.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
144.       for (i = 0; i < DB_NUMBER; i++) {
145. >         irow[i] = row[i];
146.           row[i] = NULL;
147.       }

apps/srp.c:146:9: 
144.       for (i = 0; i < DB_NUMBER; i++) {
145.           irow[i] = row[i];
146. >         row[i] = NULL;
147.       }
148.       irow[DB_NUMBER] = NULL;

apps/srp.c:144:32: 
142.   
143.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
144. >     for (i = 0; i < DB_NUMBER; i++) {
145.           irow[i] = row[i];
146.           row[i] = NULL;

apps/srp.c:144:17: Loop condition is false. Leaving loop
142.   
143.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
144.       for (i = 0; i < DB_NUMBER; i++) {
                       ^
145.           irow[i] = row[i];
146.           row[i] = NULL;

apps/srp.c:148:5: 
146.           row[i] = NULL;
147.       }
148. >     irow[DB_NUMBER] = NULL;
149.   
150.       if (!TXT_DB_insert(db->db, irow)) {

apps/srp.c:150:10: Taking false branch
148.       irow[DB_NUMBER] = NULL;
149.   
150.       if (!TXT_DB_insert(db->db, irow)) {
                ^
151.           BIO_printf(bio_err, "failed to update srpvfile\n");
152.           BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);

apps/srp.c:156:5: 
154.           return 0;
155.       }
156. >     return 1;
157.   }
158.   
