]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/clientid.c
radius plugin: add fclose operation to fix file pointer not closed after use (#401)
[ppp.git] / pppd / plugins / radius / clientid.c
index b1bbc4748ed9794f6ae3af328697854f97fe4eeb..eea516505d730436569aa0070ec197d9be4fbf0f 100644 (file)
@@ -68,6 +68,7 @@ int rc_read_mapfile(char *filename)
 
                        if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) {
                                novm("rc_read_mapfile");
+                               fclose(mapfd);
                                return (-1);
                        }
 
@@ -79,6 +80,7 @@ int rc_read_mapfile(char *filename)
                } else {
 
                        error("rc_read_mapfile: malformed line in %s, line %d", filename, lnr);
+                       fclose(mapfd);
                        return (-1);
 
                }