Module: sip-router
Branch: tirpi/cfg_framework_multivalue
Commit: 678625a48b213e5b2899ac418c6a4b3fde25750c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=678625a…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Fri Oct 22 14:35:33 2010 +0200
cfg framework: fix uninitialized group_inst pointers
---
cfg/cfg_ctx.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cfg/cfg_ctx.c b/cfg/cfg_ctx.c
index 606ab6b..d3ea6fe 100644
--- a/cfg/cfg_ctx.c
+++ b/cfg/cfg_ctx.c
@@ -318,7 +318,7 @@ int cfg_set_now(cfg_ctx_t *ctx, str *group_name, unsigned int
*group_id, str *va
char *old_string = NULL;
void **replaced = NULL;
cfg_child_cb_t *child_cb = NULL;
- cfg_group_inst_t *group_inst, *new_array = NULL;
+ cfg_group_inst_t *group_inst = NULL, *new_array = NULL;
unsigned char *var_block;
/* verify the context even if we do not need it now
@@ -655,7 +655,7 @@ int cfg_set_delayed(cfg_ctx_t *ctx, str *group_name, unsigned int
*group_id, str
cfg_changed_var_t *changed = NULL, **changed_p;
int size;
str s;
- cfg_group_inst_t *group_inst;
+ cfg_group_inst_t *group_inst = NULL;
unsigned char *var_block;
if (!cfg_shmized)
@@ -934,7 +934,7 @@ int cfg_commit(cfg_ctx_t *ctx)
void *p;
str s, s2;
cfg_group_t *group;
- cfg_group_inst_t *group_inst;
+ cfg_group_inst_t *group_inst = NULL;
if (!ctx) {
LOG(L_ERR, "ERROR: cfg_commit(): context is undefined\n");
@@ -1022,7 +1022,7 @@ int cfg_commit(cfg_ctx_t *ctx)
if (!changed->group_id_set) {
p = CFG_GROUP_DATA(block, changed->group)
+ changed->var->offset;
- group_inst = NULL; /* fore the look-up of the next group_inst */
+ group_inst = NULL; /* force the look-up of the next group_inst */
} else {
if (group != changed->group) {
/* The group array has not been cloned yet. */