]> git.webhop.me Git - lcd4linux.git/commitdiff
Fixed a segmentation fault bug in cfg_get().
authormjona <mjona@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 12 Feb 2010 13:16:27 +0000 (13:16 +0000)
committermjona <mjona@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Fri, 12 Feb 2010 13:16:27 +0000 (13:16 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@1109 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

cfg.c

diff --git a/cfg.c b/cfg.c
index fe1a5515531effb55f28e757b1ae28899fc9c062..c09f34e50350a6581e6c96205c8b5e686bbe6d70 100644 (file)
--- 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);