diff mbox series

[05/13] getnetconfig.c: cppcheck_warning

Message ID 20180907180151.178872-6-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series libtirpc: Closed a number of memory leaks | expand

Commit Message

Steve Dickson Sept. 7, 2018, 6:01 p.m. UTC
Memory leak: p
Memory leak: tmp

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 src/getnetconfig.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/src/getnetconfig.c b/src/getnetconfig.c
index 92e7c43..d67d97d 100644
--- a/src/getnetconfig.c
+++ b/src/getnetconfig.c
@@ -709,6 +709,8 @@  struct netconfig	*ncp;
     p->nc_lookups = (char **)malloc((size_t)(p->nc_nlookups+1) * sizeof(char *));
     if (p->nc_lookups == NULL) {
 	free(p->nc_netid);
+	free(p);
+	free(tmp);
 	return(NULL);
     }
     for (i=0; i < p->nc_nlookups; i++) {