Apply patch from Scott Lamb fixing some memory and resource leaks.
[oweals/tinc.git] / src / process.c
index fc08bc10d7530f5bf7ad3496cd3880be92cb60a9..30ff82ad5ec700d86de5af753a65cbc388d4f00e 100644 (file)
@@ -1,7 +1,7 @@
 /*
     process.c -- process management functions
-    Copyright (C) 1999-2005 Ivo Timmermans <ivo@tinc-vpn.org>,
-                  2000-2005 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 1999-2005 Ivo Timmermans,
+                  2000-2006 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -379,8 +379,10 @@ bool execute_script(const char *name, char **envp)
 
        /* First check if there is a script */
 
-       if(stat(scriptname + 1, &s))
+       if(stat(scriptname + 1, &s)) {
+               free(scriptname);
                return true;
+       }
 
        ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);