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


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

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

apps/apps.c:976:1: start of procedure app_malloc()
  974.   }
  975.   
  976. > void* app_malloc(int sz, const char *what)
  977.   {
  978.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:978:5: 
  976.   void* app_malloc(int sz, const char *what)
  977.   {
  978. >     void *vp = OPENSSL_malloc(sz);
  979.   
  980.       if (vp == 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.   #ifndef OPENSSL_NO_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)

apps/apps.c:980:9: Taking false branch
  978.       void *vp = OPENSSL_malloc(sz);
  979.   
  980.       if (vp == NULL) {
                 ^
  981.           BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
  982.                   opt_getprog(), sz, what);

apps/apps.c:986:5: 
  984.           exit(1);
  985.       }
  986. >     return vp;
  987.   }
  988.   

apps/apps.c:987:1: return from a call to app_malloc
  985.       }
  986.       return vp;
  987. > }
  988.   
  989.   

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

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

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

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

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

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

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

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

apps/srp.c:153:5: 
151.           return 0;
152.       }
153. >     return 1;
154.   }
155.   
