Skip to content

Commit

Permalink
pppd/plugins/radius/clientid.c: handle strdup failure (#507)
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Shipitsin <[email protected]>
  • Loading branch information
chipitsine authored Aug 17, 2024
1 parent cb59395 commit fa612cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pppd/plugins/radius/clientid.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ int rc_read_mapfile(char *filename)
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;
Expand Down

0 comments on commit fa612cb

Please sign in to comment.