This reverts commit f138e68e7ffefa3f4d71857ddb137fff877fd1d0. There was no memory leak and freeing allocated memory is not a good thing Signed-off-by: Steve Dickson <steved@xxxxxxxxxx> --- src/getnetconfig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/getnetconfig.c b/src/getnetconfig.c index 7888f8c..d547dce 100644 --- a/src/getnetconfig.c +++ b/src/getnetconfig.c @@ -503,7 +503,9 @@ getnetconfigent(netid) break; } } while (stringp != NULL); - free(linep); + if (ncp == NULL) { + free(linep); + } fclose(file); return(ncp); } -- 2.47.0