Files
sispmctl/socket_init-avoid-memory-leak.patch
2025-12-16 14:15:23 +01:00

29 lines
750 B
Diff

From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Fri Nov 15 17:58:39 2024 +0100
Subject: socket_init: avoid memory leak
Patch-mainline: Not yet
Git-repo: https://git.code.sf.net/p/sispmctl/git
Git-commit: 34d7f3c6bb07d5c60cf9f4b7a72a0164bf14f376
References:
Free allocated memory in case of an error.
Addresses-Coverity-ID: 512010 Resource leak
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Egbert Eich <eich@suse.de>
---
src/socket.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/socket.c b/src/socket.c
index 0e76a99..f4c6eec 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -148,6 +148,7 @@ int *socket_init(char *bind_arg)
socket_error:
close(*s);
+ free(s);
return NULL;
}
#endif // !WEBLESS