summaryrefslogtreecommitdiff
path: root/gconfig.c
diff options
context:
space:
mode:
authorvenaas <venaas>2008-05-30 14:17:52 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-05-30 14:17:52 +0000
commit6515ce3d742c1273484a52833b157477575fdd99 (patch)
tree7a26e2a3190a25fd58b120b01177f844b09ba322 /gconfig.c
parentc62df2e2a4797482cb2247400d6ae4830df25a3d (diff)
gconfig cbs now return int. almost finished receiving all dynamic server config, just need to handle failing stringcopy
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@267 e88ac4ed-0b26-0410-9574-a7f39faa03bf
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;