projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure we do not allocate new edge when talking to old nodes and the same edge...
[tinc]
/
src
/
script.c
diff --git
a/src/script.c
b/src/script.c
index
6389cb4
..
55473b1
100644
(file)
--- a/
src/script.c
+++ b/
src/script.c
@@
-1,7
+1,7
@@
/*
script.c -- call an external script
Copyright (C) 1999-2005 Ivo Timmermans,
/*
script.c -- call an external script
Copyright (C) 1999-2005 Ivo Timmermans,
- 2000-201
3
Guus Sliepen <guus@tinc-vpn.org>
+ 2000-201
5
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
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
@@
-28,10
+28,10
@@
bool execute_script(const char *name, char **envp) {
#ifdef HAVE_SYSTEM
bool execute_script(const char *name, char **envp) {
#ifdef HAVE_SYSTEM
- char
*scriptname
;
+ char
scriptname[PATH_MAX]
;
char *command;
char *command;
-
xasprintf(&
scriptname, "%s" SLASH "%s%s", confbase, name, scriptextension);
+
snprintf(scriptname, sizeof
scriptname, "%s" SLASH "%s%s", confbase, name, scriptextension);
/* First check if there is a script */
/* First check if there is a script */
@@
-57,17
+57,13
@@
bool execute_script(const char *name, char **envp) {
break;
p = q;
}
break;
p = q;
}
- if(!found) {
- free(scriptname);
+ if(!found)
return true;
return true;
- }
} else
#endif
} else
#endif
- if(access(scriptname, F_OK)) {
- free(scriptname);
+ if(access(scriptname, F_OK))
return true;
return true;
- }
logger(DEBUG_STATUS, LOG_INFO, "Executing script %s", name);
logger(DEBUG_STATUS, LOG_INFO, "Executing script %s", name);
@@
-86,7
+82,6
@@
bool execute_script(const char *name, char **envp) {
int status = system(command);
free(command);
int status = system(command);
free(command);
- free(scriptname);
/* Unset environment */
/* Unset environment */