summary refs log tree commit diff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2019-06-06 21:48:24 +0200
committerLeah Neukirchen <chneukirchen@gmail.com>2020-05-15 18:41:13 +0200
commitd93c1e2fe413f18a985648c51f92776fc3eecebb (patch)
treea20ab00a9139bbb139f768725bae26a653fb399d
parentaa2868822b67ae7a605281b36055e2ca72a208c9 (diff)
downloadmblaze-d93c1e2fe413f18a985648c51f92776fc3eecebb.tar.gz
mblaze-d93c1e2fe413f18a985648c51f92776fc3eecebb.tar.xz
mblaze-d93c1e2fe413f18a985648c51f92776fc3eecebb.zip
mpick: always point to malloc memory in parse_string
-rw-r--r--mpick.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mpick.c b/mpick.c
index bff90b8..45c350d 100644
--- a/mpick.c
+++ b/mpick.c
@@ -544,7 +544,7 @@ parse_string(char **s)
 			buf[len] = 0;
 		pos++;
 		ws();
-		*s = buf ? buf : "";
+		*s = buf ? buf : xstrdup("");
 		return 1;
 	} else if (*pos == '$') {
 		char t;
@@ -559,7 +559,7 @@ parse_string(char **s)
 		*pos = 0;
 		*s = getenv(e);
 		if (!*s)
-			*s = "";
+			*s = xstrdup("");
 		*pos = t;
 		ws();
 		return 1;