apps/engine.c:62: error: MEMORY_LEAK
  memory dynamically allocated to `*buf` by call to `app_malloc()` at line 52, column 16 is not reachable after line 62, column 13.
Showing all 37 steps of the trace


apps/engine.c:48:1: start of procedure append_buf()
46.   };
47.   
48. > static int append_buf(char **buf, int *size, const char *s)
49.   {
50.       if (*buf == NULL) {

apps/engine.c:50:9: Taking true branch
48.   static int append_buf(char **buf, int *size, const char *s)
49.   {
50.       if (*buf == NULL) {
              ^
51.           *size = 256;
52.           *buf = app_malloc(*size, "engine buffer");

apps/engine.c:51:9: 
49.   {
50.       if (*buf == NULL) {
51. >         *size = 256;
52.           *buf = app_malloc(*size, "engine buffer");
53.           **buf = '\0';

apps/engine.c:52:9: 
50.       if (*buf == NULL) {
51.           *size = 256;
52. >         *buf = app_malloc(*size, "engine buffer");
53.           **buf = '\0';
54.       }

apps/apps.c:925:1: start of procedure app_malloc()
  923.   }
  924.   
  925. > void* app_malloc(int sz, const char *what)
  926.   {
  927.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:927:5: 
  925.   void* app_malloc(int sz, const char *what)
  926.   {
  927. >     void *vp = OPENSSL_malloc(sz);
  928.   
  929.       if (vp == NULL) {

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

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

crypto/mem.c:162:9: Taking false branch
    160.       void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    163.           return malloc_impl(num, file, line);
    164.   

crypto/mem.c:165:9: Taking false branch
    163.           return malloc_impl(num, file, line);
    164.   
    165.       if (num == 0)
                   ^
    166.           return NULL;
    167.   

crypto/mem.c:169:5: 
    167.   
    168.       FAILTEST();
    169. >     allow_customize = 0;
    170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:179:24: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:180:5: 
    178.   #else
    179.       osslargused(file); osslargused(line);
    180. >     ret = malloc(num);
    181.   #endif
    182.   

crypto/mem.c:183:5: 
    181.   #endif
    182.   
    183. >     return ret;
    184.   }
    185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
    182.   
    183.       return ret;
    184. > }
    185.   
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

apps/apps.c:929:9: Taking false branch
  927.       void *vp = OPENSSL_malloc(sz);
  928.   
  929.       if (vp == NULL) {
                 ^
  930.           BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
  931.                   opt_getprog(), sz, what);

apps/apps.c:935:5: 
  933.           exit(1);
  934.       }
  935. >     return vp;
  936.   }
  937.   

apps/apps.c:936:1: return from a call to app_malloc
  934.       }
  935.       return vp;
  936. > }
  937.   
  938.   /*

apps/engine.c:53:9: 
51.           *size = 256;
52.           *buf = app_malloc(*size, "engine buffer");
53. >         **buf = '\0';
54.       }
55.   

apps/engine.c:56:9: Taking true branch
54.       }
55.   
56.       if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
              ^
57.           char *tmp;
58.           *size += 256;

apps/engine.c:58:9: 
56.       if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
57.           char *tmp;
58. >         *size += 256;
59.           tmp = OPENSSL_realloc(*buf, *size);
60.           if (tmp == NULL) {

apps/engine.c:59:9: 
57.           char *tmp;
58.           *size += 256;
59. >         tmp = OPENSSL_realloc(*buf, *size);
60.           if (tmp == NULL) {
61.               OPENSSL_free(*buf);

crypto/mem.c:196:1: start of procedure CRYPTO_realloc()
  194.   }
  195.   
  196. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)

crypto/mem.c:198:9: Taking true branch
  196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                 ^
  199.           return realloc_impl(str, num, file, line);
  200.   

crypto/mem.c:198:33: Taking true branch
  196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                                         ^
  199.           return realloc_impl(str, num, file, line);
  200.   

crypto/mem.c:199:9: Skipping __function_pointer__(): unresolved function pointer
  197.   {
  198.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
  199.           return realloc_impl(str, num, file, line);
                 ^
  200.   
  201.       FAILTEST();

crypto/mem.c:224:1: return from a call to CRYPTO_realloc
  222.       return realloc(str, num);
  223.   
  224. > }
  225.   
  226.   void *CRYPTO_clear_realloc(void *str, size_t old_len, size_t num,

apps/engine.c:60:13: Taking true branch
58.           *size += 256;
59.           tmp = OPENSSL_realloc(*buf, *size);
60.           if (tmp == NULL) {
                  ^
61.               OPENSSL_free(*buf);
62.               *buf = NULL;

apps/engine.c:61:13: 
59.           tmp = OPENSSL_realloc(*buf, *size);
60.           if (tmp == NULL) {
61. >             OPENSSL_free(*buf);
62.               *buf = NULL;
63.               return 0;

crypto/mem.c:253:1: start of procedure CRYPTO_free()
  251.   }
  252.   
  253. > void CRYPTO_free(void *str, const char *file, int line)
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:255:9: Taking true branch
  253.   void CRYPTO_free(void *str, const char *file, int line)
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  256.           free_impl(str, file, line);
  257.           return;

crypto/mem.c:255:30: Taking true branch
  253.   void CRYPTO_free(void *str, const char *file, int line)
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                      ^
  256.           free_impl(str, file, line);
  257.           return;

crypto/mem.c:256:9: Skipping __function_pointer__(): unresolved function pointer
  254.   {
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  256.           free_impl(str, file, line);
                 ^
  257.           return;
  258.       }

crypto/mem.c:257:9: 
  255.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  256.           free_impl(str, file, line);
  257. >         return;
  258.       }
  259.   

crypto/mem.c:271:1: return from a call to CRYPTO_free
  269.       free(str);
  270.   #endif
  271. > }
  272.   
  273.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

apps/engine.c:62:13: 
60.           if (tmp == NULL) {
61.               OPENSSL_free(*buf);
62. >             *buf = NULL;
63.               return 0;
64.           }
