]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a memory leak reported by Coverity.
authorRoy Marples <roy@marples.name>
Tue, 3 May 2016 11:20:47 +0000 (11:20 +0000)
committerRoy Marples <roy@marples.name>
Tue, 3 May 2016 11:20:47 +0000 (11:20 +0000)
ipv4.c

diff --git a/ipv4.c b/ipv4.c
index 297c570faf3cd0f9231585e8c10331c14dedbf17..07c5a053fb11a050fb72a3f7d90199602a35c16b 100644 (file)
--- 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);