crypto/dsa/dsa_lib.c:295: error: NULL_DEREFERENCE
  pointer `ret` last assigned on line 271 could be null and is dereferenced by call to `DH_free()` at line 295, column 5.
Showing all 10 steps of the trace


crypto/dsa/dsa_lib.c:260:1: start of procedure DSA_dup_DH()
258.   
259.   #ifndef OPENSSL_NO_DH
260. > DH *DSA_dup_DH(const DSA *r)
261.   {
262.       /*

crypto/dsa/dsa_lib.c:267:5: 
265.        */
266.   
267. >     DH *ret = NULL;
268.   
269.       if (r == NULL)

crypto/dsa/dsa_lib.c:269:9: Taking false branch
267.       DH *ret = NULL;
268.   
269.       if (r == NULL)
               ^
270.           goto err;
271.       ret = DH_new();

crypto/dsa/dsa_lib.c:271:5: 
269.       if (r == NULL)
270.           goto err;
271. >     ret = DH_new();
272.       if (ret == NULL)
273.           goto err;

crypto/dh/dh_lib.c:103:1: start of procedure DH_new()
  101.   }
  102.   
  103. > DH *DH_new(void)
  104.   {
  105.       return DH_new_method(NULL);

crypto/dh/dh_lib.c:105:5: Skipping DH_new_method(): empty list of specs
  103.   DH *DH_new(void)
  104.   {
  105.       return DH_new_method(NULL);
             ^
  106.   }
  107.   

crypto/dh/dh_lib.c:106:1: return from a call to DH_new
  104.   {
  105.       return DH_new_method(NULL);
  106. > }
  107.   
  108.   DH *DH_new_method(ENGINE *engine)

crypto/dsa/dsa_lib.c:272:9: Taking true branch
270.           goto err;
271.       ret = DH_new();
272.       if (ret == NULL)
               ^
273.           goto err;
274.       if (r->p != NULL)

crypto/dsa/dsa_lib.c:294:2: 
292.       return ret;
293.   
294. >  err:
295.       DH_free(ret);
296.       return NULL;

crypto/dsa/dsa_lib.c:295:5: 
293.   
294.    err:
295. >     DH_free(ret);
296.       return NULL;
297.   }

DH *DSA_dup_DH(const DSA *r)
{
    DH *ret = NULL;
    if (r == NULL)
        goto err;
    ret = DH_new();
    if (ret == NULL)
        goto err;
    if (r->p != NULL)
        if ((ret->p = BN_dup(r->p)) == NULL)
            goto err;
    if (r->q != NULL) {
        ret->length = BN_num_bits(r->q);
        if ((ret->q = BN_dup(r->q)) == NULL)
            goto err;
    }
    if (r->g != NULL)
        if ((ret->g = BN_dup(r->g)) == NULL)
            goto err;
    if (r->pub_key != NULL)
        if ((ret->pub_key = BN_dup(r->pub_key)) == NULL)
            goto err;
    if (r->priv_key != NULL)
        if ((ret->priv_key = BN_dup(r->priv_key)) == NULL)
            goto err;
    return ret;
 err:
    DH_free(ret);
    return NULL;
}
['DH *DSA_dup_DH(const DSA *r)\n{\n    DH *ret = NULL;\n    if (r == NULL)\n        goto err;\n    ret = DH_new();\n    if (ret == NULL)\n        goto err;\n    if (r->p != NULL)\n        if ((ret->p = BN_dup(r->p)) == NULL)\n            goto err;\n    if (r->q != NULL) {\n        ret->length = BN_num_bits(r->q);\n        if ((ret->q = BN_dup(r->q)) == NULL)\n            goto err;\n    }\n    if (r->g != NULL)\n        if ((ret->g = BN_dup(r->g)) == NULL)\n            goto err;\n    if (r->pub_key != NULL)\n        if ((ret->pub_key = BN_dup(r->pub_key)) == NULL)\n            goto err;\n    if (r->priv_key != NULL)\n        if ((ret->priv_key = BN_dup(r->priv_key)) == NULL)\n            goto err;\n    return ret;\n err:\n    DH_free(ret);\n    return NULL;\n}', 'DH *DH_new(void)\n{\n    return DH_new_method(NULL);\n}']