[PATCH] nfs-server-generator: fix a potential memory leak issue

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

 



Signed-off-by: ChunYu Wang <chunwang@xxxxxxxxxx>
---
Fix a potential memory leak issue caused by unfree pathname 'path'.

 systemd/nfs-server-generator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c
index 4aa6509..441cec5 100644
--- a/systemd/nfs-server-generator.c
+++ b/systemd/nfs-server-generator.c
@@ -139,6 +139,7 @@ int main(int argc, char *argv[])
 	strcat(path, filebase);
 	f = fopen(path, "w");
 	if (!f)
+		free(path);
 		exit(1);
 	fprintf(f, "# Automatically generated by nfs-server-generator\n\n[Unit]\n");
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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