summaryrefslogtreecommitdiff
path: root/gconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'gconfig.c')
-rw-r--r--gconfig.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gconfig.c b/gconfig.c
index 555a52f..b43f157 100644
--- a/gconfig.c
+++ b/gconfig.c
@@ -112,9 +112,6 @@ FILE *pushgconffile(struct gconffile **cf, FILE *file, const char *description)
}
FILE *pushgconfpath(struct gconffile **cf, const char *path) {
- int i;
- struct gconffile *newcf;
- char *pathcopy;
FILE *f;
f = fopen(path, "r");
@@ -359,7 +356,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
char *opt = NULL, *val, *word, *optval, **str = NULL, ***mstr = NULL, **newmstr;
uint8_t *bln;
int type = 0, conftype = 0, n;
- void (*cbk)(struct gconffile **, void *, char *, char *, char *) = NULL;
+ int (*cbk)(struct gconffile **, void *, char *, char *, char *) = NULL;
void *cbkarg = NULL;
for (;;) {
@@ -398,7 +395,7 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
goto errparam;
break;
case CONF_CBK:
- cbk = va_arg(ap, void (*)(struct gconffile **, void *, char *, char *, char *));
+ cbk = va_arg(ap, int (*)(struct gconffile **, void *, char *, char *, char *));
if (!cbk)
goto errparam;
cbkarg = va_arg(ap, void *);
@@ -468,7 +465,10 @@ int getgenericconfig(struct gconffile **cf, char *block, ...) {
goto errexit;
}
sprintf(optval, "%s %s", opt, val);
- cbk(cf, cbkarg, optval, opt, val);
+ if (!cbk(cf, cbkarg, optval, opt, val)) {
+ free(optval);
+ goto errexit;
+ }
free(val);
free(optval);
continue;