From: Roy Marples Date: Tue, 3 May 2016 11:20:47 +0000 (+0000) Subject: Fix a memory leak reported by Coverity. X-Git-Tag: v6.11.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1179644e98bc1e9ad09c56dafb172ead5f62da98;p=thirdparty%2Fdhcpcd.git Fix a memory leak reported by Coverity. --- diff --git a/ipv4.c b/ipv4.c index 297c570f..07c5a053 100644 --- a/ipv4.c +++ b/ipv4.c @@ -841,6 +841,7 @@ ipv4_buildroutes(struct dhcpcd_ctx *ctx) if ((dnr = malloc(sizeof(*dnr))) == NULL) { logger(ifp->ctx, LOG_ERR, "%s: malloc %m", __func__); + free(rt); continue; } TAILQ_INIT(dnr);