[PATCH] [nfs/nfs-utils/libtirpc] getnetconfig.c: free linep to avoid memory leakage

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

 



Signed-off-by: Zhi Li <yieli@xxxxxxxxxx>
---
 src/getnetconfig.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/getnetconfig.c b/src/getnetconfig.c
index 9acd8c7..afbf8b5 100644
--- a/src/getnetconfig.c
+++ b/src/getnetconfig.c
@@ -507,9 +507,7 @@ getnetconfigent(netid)
 	    break;
 	}
     } while (stringp != NULL);
-    if (ncp == NULL) {
-	free(linep);
-    }
+    free(linep);
     fclose(file);
     return(ncp);
 }
-- 
2.39.0




[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