From: Wouter Wijngaards Date: Mon, 16 Nov 2009 13:36:54 +0000 (+0000) Subject: Fix#282 libunbound memleak on error condition by Eric Sesterhenn. X-Git-Tag: release-1.4.0~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62ab524058bfc4a6e2c16390dc7deba724af3a3a;p=thirdparty%2Funbound.git Fix#282 libunbound memleak on error condition by Eric Sesterhenn. git-svn-id: file:///svn/unbound/trunk@1906 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 57854222e..9b3b9a06e 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 16 November 2009: Wouter - Fixed signer detection of CNAME responses without signatures. + - Fix#282 libunbound memleak on error condition by Eric Sesterhenn. 13 November 2009: Wouter - Fixed validation failure for CNAME to optout NSEC3 nodata answer. diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index e22dd5571..a30177d72 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -267,6 +267,7 @@ ub_ctx_add_ta(struct ub_ctx* ctx, char* ta) lock_basic_lock(&ctx->cfglock); if(ctx->finalized) { lock_basic_unlock(&ctx->cfglock); + free(dup); return UB_AFTERFINAL; } if(!cfg_strlist_insert(&ctx->env->cfg->trust_anchor_list, dup)) { @@ -286,6 +287,7 @@ ub_ctx_add_ta_file(struct ub_ctx* ctx, char* fname) lock_basic_lock(&ctx->cfglock); if(ctx->finalized) { lock_basic_unlock(&ctx->cfglock); + free(dup); return UB_AFTERFINAL; } if(!cfg_strlist_insert(&ctx->env->cfg->trust_anchor_file_list, dup)) { @@ -305,6 +307,7 @@ ub_ctx_trustedkeys(struct ub_ctx* ctx, char* fname) lock_basic_lock(&ctx->cfglock); if(ctx->finalized) { lock_basic_unlock(&ctx->cfglock); + free(dup); return UB_AFTERFINAL; } if(!cfg_strlist_insert(&ctx->env->cfg->trusted_keys_file_list, dup)) {