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.
(cherry picked from commit 4a6c66288f)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user