Fixed an error case that wasn't being handled properly, causing a
authorpacman <pacman>
Thu, 21 Dec 2000 05:12:02 +0000 (05:12 +0000)
committerpacman <pacman>
Thu, 21 Dec 2000 05:12:02 +0000 (05:12 +0000)
segfault if there was a problem building the cache

src/modules/rlm_unix/rlm_unix.c

index 51ab814..9ab3647 100644 (file)
@@ -202,6 +202,12 @@ static int unix_instantiate(CONF_SECTION *conf, void **instance)
                 {
                        radlog(L_ERR, "HASH:  unable to create user "
                                "hash table.  disable caching and run debugs");
+                       free((char *) inst->passwd_file);
+                       free((char *) inst->shadow_file);
+                       free((char *) inst->group_file);
+                       free((char *) inst->radwtmp);
+                       free(inst);
+                       return -1;
                }
        } else {
                inst->cache = NULL;