Message ID | 20241114010011.544247-1-steved@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Revert "getnetconfig.c: free linep to avoid memory leakage" | expand |
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); }