Module Name:    src
Committed By:   wiz
Date:           Tue Jan  4 09:42:21 UTC 2011

Modified Files:
        src/usr.sbin/ldpd: mpls_interface.c

Log Message:
Fix memory leak in error case. Found by cppcheck.

XXX: so_tag has same problem?


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/ldpd/mpls_interface.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/ldpd/mpls_interface.c
diff -u src/usr.sbin/ldpd/mpls_interface.c:1.2 src/usr.sbin/ldpd/mpls_interface.c:1.3
--- src/usr.sbin/ldpd/mpls_interface.c:1.2	Thu Dec  9 00:10:59 2010
+++ src/usr.sbin/ldpd/mpls_interface.c	Tue Jan  4 09:42:21 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mpls_interface.c,v 1.2 2010/12/09 00:10:59 christos Exp $ */
+/* $NetBSD: mpls_interface.c,v 1.3 2011/01/04 09:42:21 wiz Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -198,6 +198,7 @@
 		so_ifa = malloc(sizeof(*so_ifa));
 		if (!so_ifa) {
 			fatalp("Out of memory\n");
+			free(so_nexthop);
 			return LDP_E_MEMORY;
 		}
 		memcpy(so_ifa, so_oldifa, so_oldifa->sa.sa_len);

Reply via email to