diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-02-21 13:42:25 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-02-21 13:42:25 +0200 |
commit | 599a468169078449b68e7c0ef711c14fb746f0ea (patch) | |
tree | c691d411a3cc3b9e00e8c1f4603575c878bfd48a /src | |
parent | 6aac230ce3d21f1e71333ec3863c7ea1afd051c3 (diff) | |
download | pies-599a468169078449b68e7c0ef711c14fb746f0ea.tar.gz pies-599a468169078449b68e7c0ef711c14fb746f0ea.tar.bz2 |
Bugfixes.
* src/pies.c (_cb_command,_cb_env): Free wordsplit struct.
(main): Allocate log_tag. Otherwise it might get overwritten
by mf_proctitle_format.
Diffstat (limited to 'src')
-rw-r--r-- | src/pies.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -540,8 +540,8 @@ _cb_command (enum grecs_callback_command cmd, grecs_error (locus, 0, "wordsplit: %s", strerror (errno)); return 1; } - comp->argc = ws.ws_wordc; - comp->argv = ws.ws_wordv; + wordsplit_getwords (&ws, &comp->argc, &comp->argv); + wordsplit_free (&ws); break; case GRECS_TYPE_ARRAY: @@ -582,6 +582,7 @@ _cb_env (enum grecs_callback_command cmd, grecs_locus_t *locus, void *varptr, grecs_value_t *value, void *cb_data) { + size_t argc; char **argv; char ***penv = varptr; struct wordsplit ws; @@ -594,9 +595,8 @@ _cb_env (enum grecs_callback_command cmd, grecs_error (locus, 0, "wordsplit: %s", strerror (errno)); return 1; } - argv = ws.ws_wordv; - ws.ws_wordc = 0; - ws.ws_wordv = NULL; + wordsplit_getwords (&ws, &argc, &argv); + wordsplit_free (&ws); break; case GRECS_TYPE_ARRAY: @@ -2075,7 +2075,7 @@ main (int argc, char **argv) instance++; } setenv ("PIES_INSTANCE", instance, 1); - log_tag = instance; + log_tag = grecs_strdup (instance); if (!init_process) set_conf_file_names (instance); |