aboutsummaryrefslogtreecommitdiff
path: root/networking/ifupdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r--networking/ifupdown.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 818bec2d6..f91eddae8 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -1019,7 +1019,7 @@ static int doit(char *str)
static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *opt)
{
int i;
- char *buf;
+ char *buf[2];
for (i = 0; i < ifd->n_options; i++) {
if (strcmp(ifd->option[i].name, opt) == 0) {
@@ -1029,10 +1029,11 @@ static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *o
}
}
- buf = xmalloc(bb_strlen(opt) + 19);
- sprintf(buf, "/etc/network/if-%s.d", opt);
- run_parts(&buf, 2);
- free(buf);
+ bb_xasprintf(&buf[0], "/etc/network/if-%s.d", opt);
+ buf[1] = NULL;
+
+ run_parts(&buf, 2, environ);
+ free(buf[0]);
return (1);
}