Fix a memory leak in dns_dlzcreate()

dns_dlzcreate() fails to free the memory allocated for dlzname
when an error occurs.

Free dlzname's memory (acquired earlier with isc_mem_strdup())
by calling isc_mem_free() before returning an error code.
This commit is contained in:
Aram Sargsyan 2022-01-04 18:49:20 +00:00
parent 5f9d4b5db4
commit 4a6c66288f

View file

@ -230,6 +230,7 @@ dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername,
/* impinfo->methods->create failed. */
RWUNLOCK(&dlz_implock, isc_rwlocktype_read);
isc_mem_free(mctx, db->dlzname);
isc_mem_put(mctx, db, sizeof(dns_dlzdb_t));
return (result);
}