exec: free up memory on shutdown
authorYousong Zhou <zhouyousong@yunionyun.com>
Mon, 14 Oct 2019 06:48:56 +0000 (06:48 +0000)
committerYousong Zhou <zhouyousong@yunionyun.com>
Tue, 15 Oct 2019 07:51:56 +0000 (07:51 +0000)
src/exec.c

index 9574f2c..a0e534c 100644 (file)
@@ -919,6 +919,11 @@ static int exec_shutdown(void) /* {{{ */
       INFO("exec plugin: Sent SIGTERM to %hu", (unsigned short int)pl->pid);
     }
 
+    for (int i = 0; pl->argv[i] != NULL; i++) {
+      sfree(pl->argv[i]);
+    }
+    sfree(pl->argv);
+    sfree(pl->exec);
     sfree(pl->user);
     sfree(pl);