mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
1173. [bug] Potential leaks in isc_log_create() and
isc_log_settag(). [RT #2336]
This commit is contained in:
parent
ac69ec1294
commit
cad61731f8
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
|||||||
|
1173. [bug] Potential leaks in isc_log_create() and
|
||||||
|
isc_log_settag(). [RT #2336]
|
||||||
|
|
||||||
1172. [doc] Add CERT, GPOS, KX, NAPTR, NSAP, PX and TXT to
|
1172. [doc] Add CERT, GPOS, KX, NAPTR, NSAP, PX and TXT to
|
||||||
table of RR types in ARM.
|
table of RR types in ARM.
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: log.c,v 1.72 2001/11/30 01:59:34 gson Exp $ */
|
/* $Id: log.c,v 1.73 2002/01/09 06:16:10 marka Exp $ */
|
||||||
|
|
||||||
/* Principal Authors: DCL */
|
/* Principal Authors: DCL */
|
||||||
|
|
||||||
@ -302,9 +302,12 @@ isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp) {
|
|||||||
if (lcfgp != NULL)
|
if (lcfgp != NULL)
|
||||||
*lcfgp = lcfg;
|
*lcfgp = lcfg;
|
||||||
|
|
||||||
} else
|
} else {
|
||||||
|
if (lcfg != NULL)
|
||||||
|
isc_logconfig_destroy(&lcfg);
|
||||||
if (lctx != NULL)
|
if (lctx != NULL)
|
||||||
isc_log_destroy(&lctx);
|
isc_log_destroy(&lctx);
|
||||||
|
}
|
||||||
|
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
@ -980,6 +983,8 @@ isc_log_settag(isc_logconfig_t *lcfg, const char *tag) {
|
|||||||
REQUIRE(VALID_CONFIG(lcfg));
|
REQUIRE(VALID_CONFIG(lcfg));
|
||||||
|
|
||||||
if (tag != NULL && *tag != '\0') {
|
if (tag != NULL && *tag != '\0') {
|
||||||
|
if (lcfg->tag != NULL)
|
||||||
|
isc_mem_free(lcfg->lctx->mctx, lcfg->tag);
|
||||||
lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
|
lcfg->tag = isc_mem_strdup(lcfg->lctx->mctx, tag);
|
||||||
if (lcfg->tag == NULL)
|
if (lcfg->tag == NULL)
|
||||||
return (ISC_R_NOMEMORY);
|
return (ISC_R_NOMEMORY);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user