[pve-devel] [PATCH ha-manager 4/5] free cmd pointer after it's execution

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jan 11 13:20:17 CET 2016


Quoting the asprintf man page:
> [..]
> This pointer should be passed to free(3) to release the allocated
> storage when it is  no  longer needed.
> [..]

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/watchdog-mux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/watchdog-mux.c b/src/watchdog-mux.c
index 46046ed..7367077 100644
--- a/src/watchdog-mux.c
+++ b/src/watchdog-mux.c
@@ -127,6 +127,7 @@ main(void)
             }
             fprintf(stderr, "Loading watchdog module '%s'\n", wd_module);
             system(cmd);
+            free(cmd);
         } else {
             system("modprobe -q softdog"); // load softdog by default
         }
-- 
2.1.4





More information about the pve-devel mailing list