diff options
Diffstat (limited to 'hush.c')
-rw-r--r-- | hush.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -469,7 +469,10 @@ static int builtin_export(struct child_prog *child) | |||
469 | if (child->argv[1] == NULL) { | 469 | if (child->argv[1] == NULL) { |
470 | return (builtin_env(child)); | 470 | return (builtin_env(child)); |
471 | } | 471 | } |
472 | res = putenv(child->argv[1]); | 472 | /* FIXME -- I leak memory. This will be |
473 | * fixed up properly when we add local | ||
474 | * variable support -- I hope */ | ||
475 | res = putenv(strdup(child->argv[1])); | ||
473 | if (res) | 476 | if (res) |
474 | fprintf(stderr, "export: %s\n", strerror(errno)); | 477 | fprintf(stderr, "export: %s\n", strerror(errno)); |
475 | return (res); | 478 | return (res); |