From: mjona Date: Fri, 12 Feb 2010 13:16:27 +0000 (+0000) Subject: Fixed a segmentation fault bug in cfg_get(). X-Git-Tag: svn1203~94 X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=4f3ae24f7c6365082e1bde846a9d39b7a337e228;p=lcd4linux.git Fixed a segmentation fault bug in cfg_get(). git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1109 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- diff --git a/cfg.c b/cfg.c index fe1a551..c09f34e 100644 --- a/cfg.c +++ b/cfg.c @@ -391,7 +391,7 @@ char *cfg_get(const char *section, const char *key, const char *defval) if (expression != NULL) { if (*expression == '\0') - return ""; + return strdup(""); if (Compile(expression, &tree) == 0 && Eval(tree, &result) == 0) { retval = strdup(R2S(&result)); DelTree(tree);