From: Ralph Dolmans Date: Wed, 23 Nov 2016 11:21:10 +0000 (+0000) Subject: Check and free data allocated by fname_after_chroot X-Git-Tag: release-1.6.0rc1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dce3856cdec3fe0b6f59a771753c67c36fcfb4a;p=thirdparty%2Funbound.git Check and free data allocated by fname_after_chroot git-svn-id: file:///svn/unbound/trunk@3935 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/smallapp/unbound-checkconf.c b/smallapp/unbound-checkconf.c index e4c36c81c..6670d87dc 100644 --- a/smallapp/unbound-checkconf.c +++ b/smallapp/unbound-checkconf.c @@ -97,7 +97,10 @@ static void print_option(struct config_file* cfg, const char* opt, int final) { if(strcmp(opt, "pidfile") == 0 && final) { - printf("%s\n", fname_after_chroot(cfg->pidfile, cfg, 1)); + char *p = fname_after_chroot(cfg->pidfile, cfg, 1); + if(!p) fatal_exit("out of memory"); + printf("%s\n", p); + free(p); return; } if(!config_get_option(cfg, opt, config_print_func, stdout))