radclient = malloc(sizeof(*radclient));
if (!radclient) {
perror("radclient: X");
+ if (fp != stdin) fclose(fp);
return NULL; /* memory leak "start" */
}
memset(radclient, 0, sizeof(*radclient));
if (!radclient->request) {
librad_perror("radclient: Y");
radclient_free(radclient);
+ if (fp != stdin) fclose(fp);
return NULL; /* memory leak "start" */
}
radclient->request->vps = readvp2(fp, &filedone, "radclient:");
if (!radclient->request->vps) {
radclient_free(radclient);
+ if (fp != stdin) fclose(fp);
return start; /* done: return the list */
}