apps/srp.c:102: error: NULL_DEREFERENCE
  pointer `irow` last assigned on line 100 could be null and is dereferenced at line 102, column 9.
Showing all 19 steps of the trace


apps/srp.c:95:1: start of procedure update_index()
93.   }
94.   
95. > static int update_index(CA_DB *db, char **row)
96.   {
97.       char **irow;

apps/srp.c:100:5: 
98.       int i;
99.   
100. >     irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101.       for (i = 0; i < DB_NUMBER; i++)
102.           irow[i] = row[i];

test/testutil/apps_mem.c:14:1: start of procedure app_malloc()
  12.   /* shim that avoids sucking in too much from apps/apps.c */
  13.   
  14. > void* app_malloc(int sz, const char *what)
  15.   {
  16.       void *vp = OPENSSL_malloc(sz);

test/testutil/apps_mem.c:16:5: 
  14.   void* app_malloc(int sz, const char *what)
  15.   {
  16. >     void *vp = OPENSSL_malloc(sz);
  17.   
  18.       return vp;

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

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

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

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

crypto/mem.c:204:9: Taking false branch
    202.   
    203.       FAILTEST();
    204.       if (allow_customize) {
                   ^
    205.           /*
    206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:221:5: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:221:19: 
    219.       }
    220.   #else
    221. >     (void)(file); (void)(line);
    222.       ret = malloc(num);
    223.   #endif

crypto/mem.c:222:5: 
    220.   #else
    221.       (void)(file); (void)(line);
    222. >     ret = malloc(num);
    223.   #endif
    224.   

crypto/mem.c:225:5: 
    223.   #endif
    224.   
    225. >     return ret;
    226.   }
    227.   

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

test/testutil/apps_mem.c:18:5: 
  16.       void *vp = OPENSSL_malloc(sz);
  17.   
  18. >     return vp;
  19.   }

test/testutil/apps_mem.c:19:1: return from a call to app_malloc
  17.   
  18.       return vp;
  19. > }

apps/srp.c:101:10: 
99.   
100.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101. >     for (i = 0; i < DB_NUMBER; i++)
102.           irow[i] = row[i];
103.       irow[DB_NUMBER] = NULL;

apps/srp.c:101:17: Loop condition is true. Entering loop body
99.   
100.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101.       for (i = 0; i < DB_NUMBER; i++)
                       ^
102.           irow[i] = row[i];
103.       irow[DB_NUMBER] = NULL;

apps/srp.c:102:9: 
100.       irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
101.       for (i = 0; i < DB_NUMBER; i++)
102. >         irow[i] = row[i];
103.       irow[DB_NUMBER] = NULL;
104.   
