[PATCH 05/13] getnetconfig.c: cppcheck_warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Memory leak: p
Memory leak: tmp

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

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++) {
-- 
2.17.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux