resource leak in hmac_fromdns
*** CID 1440499: Resource leaks (RESOURCE_LEAK)
/lib/dns/hmac_link.c: 363 in hmac_fromdns()
357 memset(hkey->key, 0, sizeof(hkey->key));
358
359 /* Hash the key if the key is longer then chosen MD block size */
360 if (r.length > (unsigned int)isc_md_type_get_block_size(type)) {
361 if (isc_md(type, r.base, r.length, hkey->key, &keylen)
362 != ISC_R_SUCCESS) {
CID 1440499: Resource leaks (RESOURCE_LEAK)
Variable "hkey" going out of scope leaks the storage it points to.
363 return (DST_R_OPENSSLFAILURE);
364 }
365 } else {
366 memmove(hkey->key, r.base, r.length);
367 keylen = r.length;
368 }
Edited by Mark Andrews