Apply patch from Scott Lamb fixing some memory and resource leaks.
[oweals/tinc.git] / src / process.c
index 0ea65b3195f39c17ab5b47b0459224fc09ab4e52..30ff82ad5ec700d86de5af753a65cbc388d4f00e 100644 (file)
@@ -1,7 +1,7 @@
 /*
     process.c -- process management functions
-    Copyright (C) 1999-2004 Ivo Timmermans <ivo@tinc-vpn.org>,
-                  2000-2004 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);