Changeset 5fd1894ad04542945430bed21cc582a937f8edcb for src
- Timestamp:
- 04/22/12 16:46:08 (1 year ago)
- git-parent:
- Files:
-
- src/noit_conf_checks.c (modified) (5 diffs)
- src/noit_console.c (modified) (1 diff)
- src/noit_console_complete.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/noit_conf_checks.c
r658ca09 r5fd1894 118 118 nc_attr_show(noit_console_closure_t ncct, const char *name, xmlNodePtr cnode, 119 119 xmlNodePtr anode, const char *value) { 120 c onst char *cpath, *apath;121 cpath = cnode ? (char *)xmlGetNodePath(cnode) : "";122 apath = anode ? (char *)xmlGetNodePath(anode) : "";120 char *cpath, *apath; 121 cpath = cnode ? (char *)xmlGetNodePath(cnode) : strdup(""); 122 apath = anode ? (char *)xmlGetNodePath(anode) : strdup(""); 123 123 nc_printf(ncct, " %s: %s", name, value ? value : "[undef]"); 124 124 if(value && cpath && apath) { … … 134 134 } 135 135 nc_write(ncct, "\n", 1); 136 if(cpath) free(cpath); 137 if(apath) free(apath); 136 138 } 137 139 static void … … 447 449 } 448 450 nc_printf(ncct, "==== %s ====\n", uuid_conf); 451 free(uuid_conf); 449 452 450 453 #define MYATTR(a,n,b) _noit_conf_get_string(node, &(n), "@" #a, &(b)) … … 456 459 INHERIT(a, anode, value); \ 457 460 nc_attr_show(ncct, #a, node, anode, value); \ 461 if(value != NULL) free(value); \ 458 462 } while(0) 459 463 … … 464 468 nc_printf(ncct, " name: %s [from module]\n", module ? module : "[undef]"); 465 469 nc_attr_show(ncct, "module", node, mnode, module); 470 if(module) free(module); 466 471 SHOW_ATTR(target); 467 472 SHOW_ATTR(resolve_rtype); src/noit_console.c
rdfec968 r5fd1894 299 299 else if(i<0) nc_printf(ncct, "Error at offset: %d\n", 0-i); 300 300 else noit_console_state_do(ncct, cnt, cmds); 301 while(cnt>0) free(cmds[--cnt]); 301 302 } 302 303 src/noit_console_complete.c
r3e26749 r5fd1894 97 97 noit_console_closure_t ncct; 98 98 const LineInfo *li; 99 char **cmds, *curstr ;99 char **cmds, *curstr, *rv = NULL; 100 100 int len, cnt = 32; 101 101 … … 107 107 108 108 cmds = alloca(32 * sizeof(*cmds)); 109 cmds[0] = NULL; 109 110 (void) noit_tokenize(curstr, cmds, &cnt); 110 111 … … 112 113 113 114 if(!strlen(text)) { 114 cmds[cnt++] = "";115 } 116 if(cnt == 32) return NULL;117 returnnoit_console_opt_delegate(ncct, ncct->state_stack,115 cmds[cnt++] = strdup(""); 116 } 117 if(cnt != 32) 118 rv = noit_console_opt_delegate(ncct, ncct->state_stack, 118 119 ncct->state_stack->state, 119 120 cnt, cmds, state); 121 if(cmds[0]) while(cnt > 0) free(cmds[--cnt]); 122 return rv; 120 123 } 121 124 static int
