summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Larson <slioch@eng-140.vyatta.com>2008-04-09 09:47:55 -0700
committerMichael Larson <slioch@eng-140.vyatta.com>2008-04-09 09:47:55 -0700
commitf352a460fdf15ac927d1deb4672c42b334eb8e67 (patch)
treea09d31bd11d290fb477912aff4aa8929d94634cf
parentd0cb0d6c3d533e4ac8ce824409d590b6186f6208 (diff)
downloadvyatta-cfg-f352a460fdf15ac927d1deb4672c42b334eb8e67.tar.gz
vyatta-cfg-f352a460fdf15ac927d1deb4672c42b334eb8e67.zip
fix for bug 2525
-rw-r--r--src/cli_val_engine.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cli_val_engine.c b/src/cli_val_engine.c
index adf40a4..786c0cd 100644
--- a/src/cli_val_engine.c
+++ b/src/cli_val_engine.c
@@ -217,10 +217,12 @@ static char** clind_get_current_value(clind_path_ref cfg_path,
struct stat statbuf;
/* Directory reference: */
- if(!check_existence || (lstat(cfg_path_string, &statbuf) == 0)) {
- ret=(char**)realloc(ret,sizeof(char*)*1);
- ret[0]=clind_unescape(cfg_end);
- *ret_size=1;
+ if(!check_existence) {
+ if (lstat(cfg_path_string, &statbuf) == 0) {
+ ret=(char**)realloc(ret,sizeof(char*)*1);
+ ret[0]=clind_unescape(cfg_end);
+ *ret_size=1;
+ }
} else {
/* we are checking existence, and it doesn't exist */
/* return empty string */
@@ -230,7 +232,7 @@ static char** clind_get_current_value(clind_path_ref cfg_path,
*ret_size = 1;
}
}
-
+
if(ret) {
if(tmpl_end && (strcmp(tmpl_end,NODE_TAG)==0)) {
/* since it's a tag, it should be treated as a value */