From 599a468169078449b68e7c0ef711c14fb746f0ea Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 21 Feb 2016 13:42:25 +0200 Subject: Bugfixes. * src/pies.c (_cb_command,_cb_env): Free wordsplit struct. (main): Allocate log_tag. Otherwise it might get overwritten by mf_proctitle_format. --- src/pies.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pies.c b/src/pies.c index 33244ad..d1bcfd8 100644 --- a/src/pies.c +++ b/src/pies.c @@ -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); -- cgit v1.2.1