diff options
author | venaas <venaas> | 2008-05-30 14:17:52 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-05-30 14:17:52 +0000 |
commit | 6515ce3d742c1273484a52833b157477575fdd99 (patch) | |
tree | 7a26e2a3190a25fd58b120b01177f844b09ba322 /gconfig.c | |
parent | c62df2e2a4797482cb2247400d6ae4830df25a3d (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.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; |