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:915:1: start of procedure app_malloc()
  913.   }
  914.   
  915. > void* app_malloc(int sz, const char *what)
  916.   {
  917.       void *vp = OPENSSL_malloc(sz);

apps/apps.c:917:5: 
  915.   void* app_malloc(int sz, const char *what)
  916.   {
  917. >     void *vp = OPENSSL_malloc(sz);
  918.   
  919.       if (vp == NULL) {

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking false branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:81:5: 
    79.           return NULL;
    80.   
    81. >     allow_customize = 0;
    82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:91:24: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:92:5: 
    90.   #else
    91.       osslargused(file); osslargused(line);
    92. >     ret = malloc(num);
    93.   #endif
    94.   

crypto/mem.c:95:5: 
    93.   #endif
    94.   
    95. >     return ret;
    96.   }
    97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

apps/apps.c:919:9: Taking false branch
  917.       void *vp = OPENSSL_malloc(sz);
  918.   
  919.       if (vp == NULL) {
                 ^
  920.           BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
  921.                   opt_getprog(), sz, what);

apps/apps.c:925:5: 
  923.           exit(1);
  924.       }
  925. >     return vp;
  926.   }
  927.   

apps/apps.c:926:1: return from a call to app_malloc
  924.       }
  925.       return vp;
  926. > }
  927.   
  928.   /*

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:107:1: start of procedure CRYPTO_realloc()
  105.   }
  106.   
  107. > void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  108.   {
  109.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)

crypto/mem.c:109:9: Taking true branch
  107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  108.   {
  109.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                 ^
  110.           return realloc_impl(str, num, file, line);
  111.   

crypto/mem.c:109:33: Taking true branch
  107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)
  108.   {
  109.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
                                         ^
  110.           return realloc_impl(str, num, file, line);
  111.   

crypto/mem.c:110:9: Skipping __function_pointer__(): unresolved function pointer
  108.   {
  109.       if (realloc_impl != NULL && realloc_impl != &CRYPTO_realloc)
  110.           return realloc_impl(str, num, file, line);
                 ^
  111.   
  112.       if (str == NULL)

crypto/mem.c:134:1: return from a call to CRYPTO_realloc
  132.       return realloc(str, num);
  133.   
  134. > }
  135.   
  136.   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:163:1: start of procedure CRYPTO_free()
  161.   }
  162.   
  163. > void CRYPTO_free(void *str, const char *file, int line)
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking true branch
  163.   void CRYPTO_free(void *str, const char *file, int line)
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  166.           free_impl(str, file, line);
  167.           return;

crypto/mem.c:165:30: Taking true branch
  163.   void CRYPTO_free(void *str, const char *file, int line)
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                      ^
  166.           free_impl(str, file, line);
  167.           return;

crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  166.           free_impl(str, file, line);
                 ^
  167.           return;
  168.       }

crypto/mem.c:167:9: 
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  166.           free_impl(str, file, line);
  167. >         return;
  168.       }
  169.   

crypto/mem.c:181:1: return from a call to CRYPTO_free
  179.       free(str);
  180.   #endif
  181. > }
  182.   
  183.   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.           }
