4209. [bug] Address resource leaks in dlz modules. [RT #40654]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
||||
4209. [bug] Address resource leaks in dlz modules. [RT #40654]
|
||||
|
||||
4208. [bug] Address null pointer dereferences on out of memory.
|
||||
[RT #40764]
|
||||
|
||||
|
||||
@@ -617,7 +617,8 @@ dlz_allnodes(const char *zone, void *dbdata, dns_sdlzallnodes_t *allnodes) {
|
||||
DLZ_LIST_INIT(*dir_list);
|
||||
|
||||
if (create_path(zone, NULL, NULL, cd, &basepath) != ISC_R_SUCCESS) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
result = ISC_R_NOTFOUND;
|
||||
goto complete_allnds;
|
||||
}
|
||||
|
||||
/* remove path separator at end of path so stat works properly */
|
||||
@@ -852,14 +853,16 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"Filesystem driver requires "
|
||||
"6 command line args.");
|
||||
return (ISC_R_FAILURE);
|
||||
result = ISC_R_FAILURE;
|
||||
goto free_cd;
|
||||
}
|
||||
|
||||
if (strlen(argv[5]) > 1) {
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"Filesystem driver can only "
|
||||
"accept a single character for separator.");
|
||||
return (ISC_R_FAILURE);
|
||||
result = ISC_R_FAILURE;
|
||||
goto free_cd;
|
||||
}
|
||||
|
||||
/* verify base dir ends with '/' or '\' */
|
||||
@@ -869,7 +872,8 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
"Base dir parameter for filesystem driver "
|
||||
"should end with %s",
|
||||
"either '/' or '\\' ");
|
||||
return (ISC_R_FAILURE);
|
||||
result = ISC_R_FAILURE;
|
||||
goto free_cd;
|
||||
}
|
||||
|
||||
/* determine and save path separator for later */
|
||||
@@ -923,6 +927,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
"filesystem_dynamic: Filesystem driver unable to "
|
||||
"allocate memory for config data.");
|
||||
|
||||
free_cd:
|
||||
/* if we allocated a config data object clean it up */
|
||||
if (cd != NULL)
|
||||
dlz_destroy(cd);
|
||||
|
||||
@@ -566,6 +566,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"DLZ Perl '%s': Missing script argument.",
|
||||
dlzname);
|
||||
free(cd);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
@@ -573,6 +574,7 @@ dlz_create(const char *dlzname, unsigned int argc, char *argv[],
|
||||
cd->log(ISC_LOG_ERROR,
|
||||
"DLZ Perl '%s': Missing class name argument.",
|
||||
dlzname);
|
||||
free(cd);
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
perl_class_name = argv[2];
|
||||
|
||||
Reference in New Issue
Block a user