apps/ocsp.c:226: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `sk_OCSP_CERTID_new_null()` at line 222, column 11 is not reachable after line 226, column 9.
Showing all 82 steps of the trace


apps/ocsp.c:178:1: start of procedure ocsp_main()
176.   };
177.   
178. > int ocsp_main(int argc, char **argv)
179.   {
180.       BIO *acbio = NULL, *cbio = NULL, *derbio = NULL, *out = NULL;

apps/ocsp.c:180:5: 
178.   int ocsp_main(int argc, char **argv)
179.   {
180. >     BIO *acbio = NULL, *cbio = NULL, *derbio = NULL, *out = NULL;
181.       const EVP_MD *cert_id_md = NULL, *rsign_md = NULL;
182.       int trailing_md = 0;

apps/ocsp.c:181:5: 
179.   {
180.       BIO *acbio = NULL, *cbio = NULL, *derbio = NULL, *out = NULL;
181. >     const EVP_MD *cert_id_md = NULL, *rsign_md = NULL;
182.       int trailing_md = 0;
183.       CA_DB *rdb = NULL;

apps/ocsp.c:182:5: 
180.       BIO *acbio = NULL, *cbio = NULL, *derbio = NULL, *out = NULL;
181.       const EVP_MD *cert_id_md = NULL, *rsign_md = NULL;
182. >     int trailing_md = 0;
183.       CA_DB *rdb = NULL;
184.       EVP_PKEY *key = NULL, *rkey = NULL;

apps/ocsp.c:183:5: 
181.       const EVP_MD *cert_id_md = NULL, *rsign_md = NULL;
182.       int trailing_md = 0;
183. >     CA_DB *rdb = NULL;
184.       EVP_PKEY *key = NULL, *rkey = NULL;
185.       OCSP_BASICRESP *bs = NULL;

apps/ocsp.c:184:5: 
182.       int trailing_md = 0;
183.       CA_DB *rdb = NULL;
184. >     EVP_PKEY *key = NULL, *rkey = NULL;
185.       OCSP_BASICRESP *bs = NULL;
186.       OCSP_REQUEST *req = NULL;

apps/ocsp.c:185:5: 
183.       CA_DB *rdb = NULL;
184.       EVP_PKEY *key = NULL, *rkey = NULL;
185. >     OCSP_BASICRESP *bs = NULL;
186.       OCSP_REQUEST *req = NULL;
187.       OCSP_RESPONSE *resp = NULL;

apps/ocsp.c:186:5: 
184.       EVP_PKEY *key = NULL, *rkey = NULL;
185.       OCSP_BASICRESP *bs = NULL;
186. >     OCSP_REQUEST *req = NULL;
187.       OCSP_RESPONSE *resp = NULL;
188.       STACK_OF(CONF_VALUE) *headers = NULL;

apps/ocsp.c:187:5: 
185.       OCSP_BASICRESP *bs = NULL;
186.       OCSP_REQUEST *req = NULL;
187. >     OCSP_RESPONSE *resp = NULL;
188.       STACK_OF(CONF_VALUE) *headers = NULL;
189.       STACK_OF(OCSP_CERTID) *ids = NULL;

apps/ocsp.c:188:5: 
186.       OCSP_REQUEST *req = NULL;
187.       OCSP_RESPONSE *resp = NULL;
188. >     STACK_OF(CONF_VALUE) *headers = NULL;
189.       STACK_OF(OCSP_CERTID) *ids = NULL;
190.       STACK_OF(OPENSSL_STRING) *reqnames = NULL;

apps/ocsp.c:189:5: 
187.       OCSP_RESPONSE *resp = NULL;
188.       STACK_OF(CONF_VALUE) *headers = NULL;
189. >     STACK_OF(OCSP_CERTID) *ids = NULL;
190.       STACK_OF(OPENSSL_STRING) *reqnames = NULL;
191.       STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;

apps/ocsp.c:190:5: 
188.       STACK_OF(CONF_VALUE) *headers = NULL;
189.       STACK_OF(OCSP_CERTID) *ids = NULL;
190. >     STACK_OF(OPENSSL_STRING) *reqnames = NULL;
191.       STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
192.       STACK_OF(X509) *issuers = NULL;

apps/ocsp.c:191:5: 
189.       STACK_OF(OCSP_CERTID) *ids = NULL;
190.       STACK_OF(OPENSSL_STRING) *reqnames = NULL;
191. >     STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
192.       STACK_OF(X509) *issuers = NULL;
193.       X509 *issuer = NULL, *cert = NULL;

apps/ocsp.c:192:5: 
190.       STACK_OF(OPENSSL_STRING) *reqnames = NULL;
191.       STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
192. >     STACK_OF(X509) *issuers = NULL;
193.       X509 *issuer = NULL, *cert = NULL;
194.       STACK_OF(X509) *rca_cert = NULL;

apps/ocsp.c:193:5: 
191.       STACK_OF(X509) *sign_other = NULL, *verify_other = NULL, *rother = NULL;
192.       STACK_OF(X509) *issuers = NULL;
193. >     X509 *issuer = NULL, *cert = NULL;
194.       STACK_OF(X509) *rca_cert = NULL;
195.       X509 *signer = NULL, *rsigner = NULL;

apps/ocsp.c:194:5: 
192.       STACK_OF(X509) *issuers = NULL;
193.       X509 *issuer = NULL, *cert = NULL;
194. >     STACK_OF(X509) *rca_cert = NULL;
195.       X509 *signer = NULL, *rsigner = NULL;
196.       X509_STORE *store = NULL;

apps/ocsp.c:195:5: 
193.       X509 *issuer = NULL, *cert = NULL;
194.       STACK_OF(X509) *rca_cert = NULL;
195. >     X509 *signer = NULL, *rsigner = NULL;
196.       X509_STORE *store = NULL;
197.       X509_VERIFY_PARAM *vpm = NULL;

apps/ocsp.c:196:5: 
194.       STACK_OF(X509) *rca_cert = NULL;
195.       X509 *signer = NULL, *rsigner = NULL;
196. >     X509_STORE *store = NULL;
197.       X509_VERIFY_PARAM *vpm = NULL;
198.       const char *CAfile = NULL, *CApath = NULL;

apps/ocsp.c:197:5: 
195.       X509 *signer = NULL, *rsigner = NULL;
196.       X509_STORE *store = NULL;
197. >     X509_VERIFY_PARAM *vpm = NULL;
198.       const char *CAfile = NULL, *CApath = NULL;
199.       char *header, *value;

apps/ocsp.c:198:5: 
196.       X509_STORE *store = NULL;
197.       X509_VERIFY_PARAM *vpm = NULL;
198. >     const char *CAfile = NULL, *CApath = NULL;
199.       char *header, *value;
200.       char *host = NULL, *port = NULL, *path = "/", *outfile = NULL;

apps/ocsp.c:200:5: 
198.       const char *CAfile = NULL, *CApath = NULL;
199.       char *header, *value;
200. >     char *host = NULL, *port = NULL, *path = "/", *outfile = NULL;
201.       char *rca_filename = NULL, *reqin = NULL, *respin = NULL;
202.       char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;

apps/ocsp.c:201:5: 
199.       char *header, *value;
200.       char *host = NULL, *port = NULL, *path = "/", *outfile = NULL;
201. >     char *rca_filename = NULL, *reqin = NULL, *respin = NULL;
202.       char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;
203.       char *rsignfile = NULL, *rkeyfile = NULL;

apps/ocsp.c:202:5: 
200.       char *host = NULL, *port = NULL, *path = "/", *outfile = NULL;
201.       char *rca_filename = NULL, *reqin = NULL, *respin = NULL;
202. >     char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;
203.       char *rsignfile = NULL, *rkeyfile = NULL;
204.       char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;

apps/ocsp.c:203:5: 
201.       char *rca_filename = NULL, *reqin = NULL, *respin = NULL;
202.       char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;
203. >     char *rsignfile = NULL, *rkeyfile = NULL;
204.       char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
205.       char *signfile = NULL, *keyfile = NULL;

apps/ocsp.c:204:5: 
202.       char *reqout = NULL, *respout = NULL, *ridx_filename = NULL;
203.       char *rsignfile = NULL, *rkeyfile = NULL;
204. >     char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
205.       char *signfile = NULL, *keyfile = NULL;
206.       char *thost = NULL, *tport = NULL, *tpath = NULL;

apps/ocsp.c:205:5: 
203.       char *rsignfile = NULL, *rkeyfile = NULL;
204.       char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
205. >     char *signfile = NULL, *keyfile = NULL;
206.       char *thost = NULL, *tport = NULL, *tpath = NULL;
207.       int noCAfile = 0, noCApath = 0;

apps/ocsp.c:206:5: 
204.       char *sign_certfile = NULL, *verify_certfile = NULL, *rcertfile = NULL;
205.       char *signfile = NULL, *keyfile = NULL;
206. >     char *thost = NULL, *tport = NULL, *tpath = NULL;
207.       int noCAfile = 0, noCApath = 0;
208.       int accept_count = -1, add_nonce = 1, noverify = 0, use_ssl = -1;

apps/ocsp.c:207:5: 
205.       char *signfile = NULL, *keyfile = NULL;
206.       char *thost = NULL, *tport = NULL, *tpath = NULL;
207. >     int noCAfile = 0, noCApath = 0;
208.       int accept_count = -1, add_nonce = 1, noverify = 0, use_ssl = -1;
209.       int vpmtouched = 0, badsig = 0, i, ignore_err = 0, nmin = 0, ndays = -1;

apps/ocsp.c:208:5: 
206.       char *thost = NULL, *tport = NULL, *tpath = NULL;
207.       int noCAfile = 0, noCApath = 0;
208. >     int accept_count = -1, add_nonce = 1, noverify = 0, use_ssl = -1;
209.       int vpmtouched = 0, badsig = 0, i, ignore_err = 0, nmin = 0, ndays = -1;
210.       int req_text = 0, resp_text = 0, ret = 1;

apps/ocsp.c:209:5: 
207.       int noCAfile = 0, noCApath = 0;
208.       int accept_count = -1, add_nonce = 1, noverify = 0, use_ssl = -1;
209. >     int vpmtouched = 0, badsig = 0, i, ignore_err = 0, nmin = 0, ndays = -1;
210.       int req_text = 0, resp_text = 0, ret = 1;
211.   #ifndef OPENSSL_NO_SOCK

apps/ocsp.c:210:5: 
208.       int accept_count = -1, add_nonce = 1, noverify = 0, use_ssl = -1;
209.       int vpmtouched = 0, badsig = 0, i, ignore_err = 0, nmin = 0, ndays = -1;
210. >     int req_text = 0, resp_text = 0, ret = 1;
211.   #ifndef OPENSSL_NO_SOCK
212.       int req_timeout = -1;

apps/ocsp.c:212:5: 
210.       int req_text = 0, resp_text = 0, ret = 1;
211.   #ifndef OPENSSL_NO_SOCK
212. >     int req_timeout = -1;
213.   #endif
214.       long nsec = MAX_VALIDITY_PERIOD, maxage = -1;

apps/ocsp.c:214:5: 
212.       int req_timeout = -1;
213.   #endif
214. >     long nsec = MAX_VALIDITY_PERIOD, maxage = -1;
215.       unsigned long sign_flags = 0, verify_flags = 0, rflags = 0;
216.       OPTION_CHOICE o;

apps/ocsp.c:215:5: 
213.   #endif
214.       long nsec = MAX_VALIDITY_PERIOD, maxage = -1;
215. >     unsigned long sign_flags = 0, verify_flags = 0, rflags = 0;
216.       OPTION_CHOICE o;
217.       char *prog;

apps/ocsp.c:219:5: 
217.       char *prog;
218.   
219. >     reqnames = sk_OPENSSL_STRING_new_null();
220.       if (reqnames == NULL)
221.           goto end;

include/openssl/safestack.h:155:1: start of procedure sk_OPENSSL_STRING_new_null()
  153.    * dealt with in the autogenerated macros below.
  154.    */
  155. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
  156.   DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
  157.   

crypto/stack/stack.c:118:1: start of procedure OPENSSL_sk_new_null()
    116.   }
    117.   
    118. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:120:5: 
    118.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121.   }
    122.   

crypto/mem.c:198:1: start of procedure CRYPTO_zalloc()
      196.   }
      197.   
      198. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:200:5: 
      198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200. >     void *ret = CRYPTO_malloc(num, file, line);
      201.   
      202.       FAILTEST();

crypto/mem.c:170:1: start of procedure CRYPTO_malloc()
        168.   #endif
        169.   
        170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172.       void *ret = NULL;

crypto/mem.c:172:5: 
        170.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172. >     void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:174:9: Taking false branch
        172.       void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        175.           return malloc_impl(num, file, line);
        176.   

crypto/mem.c:177:9: Taking false branch
        175.           return malloc_impl(num, file, line);
        176.   
        177.       if (num == 0)
                       ^
        178.           return NULL;
        179.   

crypto/mem.c:181:5: 
        179.   
        180.       FAILTEST();
        181. >     allow_customize = 0;
        182.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        183.       if (call_malloc_debug) {

crypto/mem.c:191:5: 
        189.       }
        190.   #else
        191. >     (void)(file); (void)(line);
        192.       ret = malloc(num);
        193.   #endif

crypto/mem.c:191:19: 
        189.       }
        190.   #else
        191. >     (void)(file); (void)(line);
        192.       ret = malloc(num);
        193.   #endif

crypto/mem.c:192:5: 
        190.   #else
        191.       (void)(file); (void)(line);
        192. >     ret = malloc(num);
        193.   #endif
        194.   

crypto/mem.c:195:5: 
        193.   #endif
        194.   
        195. >     return ret;
        196.   }
        197.   

crypto/mem.c:196:1: return from a call to CRYPTO_malloc
        194.   
        195.       return ret;
        196. > }
        197.   
        198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:203:9: Taking true branch
      201.   
      202.       FAILTEST();
      203.       if (ret != NULL)
                     ^
      204.           memset(ret, 0, num);
      205.       return ret;

crypto/mem.c:204:9: 
      202.       FAILTEST();
      203.       if (ret != NULL)
      204. >         memset(ret, 0, num);
      205.       return ret;
      206.   }

crypto/mem.c:205:5: 
      203.       if (ret != NULL)
      204.           memset(ret, 0, num);
      205. >     return ret;
      206.   }
      207.   

crypto/mem.c:206:1: return from a call to CRYPTO_zalloc
      204.           memset(ret, 0, num);
      205.       return ret;
      206. > }
      207.   
      208.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:121:1: return from a call to OPENSSL_sk_new_null
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121. > }
    122.   
    123.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

include/openssl/safestack.h:155:1: return from a call to sk_OPENSSL_STRING_new_null
  153.    * dealt with in the autogenerated macros below.
  154.    */
  155. > DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING, char)
  156.   DEFINE_SPECIAL_STACK_OF_CONST(OPENSSL_CSTRING, char)
  157.   

apps/ocsp.c:220:9: Taking false branch
218.   
219.       reqnames = sk_OPENSSL_STRING_new_null();
220.       if (reqnames == NULL)
               ^
221.           goto end;
222.       ids = sk_OCSP_CERTID_new_null();

apps/ocsp.c:222:5: 
220.       if (reqnames == NULL)
221.           goto end;
222. >     ids = sk_OCSP_CERTID_new_null();
223.       if (ids == NULL)
224.           goto end;

include/openssl/ocsp.h:73:1: start of procedure sk_OCSP_CERTID_new_null()
  71.   typedef struct ocsp_cert_id_st OCSP_CERTID;
  72.   
  73. > DEFINE_STACK_OF(OCSP_CERTID)
  74.   
  75.   typedef struct ocsp_one_request_st OCSP_ONEREQ;

crypto/stack/stack.c:118:1: start of procedure OPENSSL_sk_new_null()
    116.   }
    117.   
    118. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));

crypto/stack/stack.c:120:5: 
    118.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    119.   {
    120. >     return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121.   }
    122.   

crypto/mem.c:198:1: start of procedure CRYPTO_zalloc()
      196.   }
      197.   
      198. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:200:5: 
      198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      199.   {
      200. >     void *ret = CRYPTO_malloc(num, file, line);
      201.   
      202.       FAILTEST();

crypto/mem.c:170:1: start of procedure CRYPTO_malloc()
        168.   #endif
        169.   
        170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172.       void *ret = NULL;

crypto/mem.c:172:5: 
        170.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        171.   {
        172. >     void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:174:9: Taking false branch
        172.       void *ret = NULL;
        173.   
        174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                       ^
        175.           return malloc_impl(num, file, line);
        176.   

crypto/mem.c:177:9: Taking false branch
        175.           return malloc_impl(num, file, line);
        176.   
        177.       if (num == 0)
                       ^
        178.           return NULL;
        179.   

crypto/mem.c:181:5: 
        179.   
        180.       FAILTEST();
        181. >     allow_customize = 0;
        182.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        183.       if (call_malloc_debug) {

crypto/mem.c:191:5: 
        189.       }
        190.   #else
        191. >     (void)(file); (void)(line);
        192.       ret = malloc(num);
        193.   #endif

crypto/mem.c:191:19: 
        189.       }
        190.   #else
        191. >     (void)(file); (void)(line);
        192.       ret = malloc(num);
        193.   #endif

crypto/mem.c:192:5: 
        190.   #else
        191.       (void)(file); (void)(line);
        192. >     ret = malloc(num);
        193.   #endif
        194.   

crypto/mem.c:195:5: 
        193.   #endif
        194.   
        195. >     return ret;
        196.   }
        197.   

crypto/mem.c:196:1: return from a call to CRYPTO_malloc
        194.   
        195.       return ret;
        196. > }
        197.   
        198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:203:9: Taking true branch
      201.   
      202.       FAILTEST();
      203.       if (ret != NULL)
                     ^
      204.           memset(ret, 0, num);
      205.       return ret;

crypto/mem.c:204:9: 
      202.       FAILTEST();
      203.       if (ret != NULL)
      204. >         memset(ret, 0, num);
      205.       return ret;
      206.   }

crypto/mem.c:205:5: 
      203.       if (ret != NULL)
      204.           memset(ret, 0, num);
      205. >     return ret;
      206.   }
      207.   

crypto/mem.c:206:1: return from a call to CRYPTO_zalloc
      204.           memset(ret, 0, num);
      205.       return ret;
      206. > }
      207.   
      208.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/stack/stack.c:121:1: return from a call to OPENSSL_sk_new_null
    119.   {
    120.       return OPENSSL_zalloc(sizeof(OPENSSL_STACK));
    121. > }
    122.   
    123.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

include/openssl/ocsp.h:73:1: return from a call to sk_OCSP_CERTID_new_null
  71.   typedef struct ocsp_cert_id_st OCSP_CERTID;
  72.   
  73. > DEFINE_STACK_OF(OCSP_CERTID)
  74.   
  75.   typedef struct ocsp_one_request_st OCSP_ONEREQ;

apps/ocsp.c:223:9: Taking false branch
221.           goto end;
222.       ids = sk_OCSP_CERTID_new_null();
223.       if (ids == NULL)
               ^
224.           goto end;
225.       if ((vpm = X509_VERIFY_PARAM_new()) == NULL)

apps/ocsp.c:225:9: Taking true branch
223.       if (ids == NULL)
224.           goto end;
225.       if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
               ^
226.           return 1;
227.   

apps/ocsp.c:226:9: 
224.           goto end;
225.       if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
226. >         return 1;
227.   
228.       prog = opt_init(argc, argv, ocsp_options);
