X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fradius%2Fclientid.c;h=eea516505d730436569aa0070ec197d9be4fbf0f;hb=HEAD;hp=b1bbc4748ed9794f6ae3af328697854f97fe4eeb;hpb=ba7f7e053daae846a54a1d08d3d133a5f1266ace;p=ppp.git diff --git a/pppd/plugins/radius/clientid.c b/pppd/plugins/radius/clientid.c index b1bbc47..94a23a6 100644 --- a/pppd/plugins/radius/clientid.c +++ b/pppd/plugins/radius/clientid.c @@ -1,6 +1,4 @@ /* - * $Id: clientid.c,v 1.1 2004/11/14 07:26:26 paulus Exp $ - * * Copyright (C) 1995,1996,1997 Lars Fenneberg * * See the file COPYRIGHT for the respective terms and conditions. @@ -68,10 +66,15 @@ int rc_read_mapfile(char *filename) if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) { novm("rc_read_mapfile"); + fclose(mapfd); return (-1); } - p->name = strdup(name); + if ((p->name = strdup(name)) == NULL) { + novm("rc_read_mapfile"); + fclose(mapfd); + return (-1); + } p->id = atoi(id); p->next = map2id_list; map2id_list = p; @@ -79,6 +82,7 @@ int rc_read_mapfile(char *filename) } else { error("rc_read_mapfile: malformed line in %s, line %d", filename, lnr); + fclose(mapfd); return (-1); }