summaryrefslogtreecommitdiff
path: root/nis/nis_getservlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_getservlist.c')
-rw-r--r--nis/nis_getservlist.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/nis/nis_getservlist.c b/nis/nis_getservlist.c
index bea9d4dbc0..e57649d526 100644
--- a/nis/nis_getservlist.c
+++ b/nis/nis_getservlist.c
@@ -72,6 +72,10 @@ nis_getservlist (const_nis_name dir)
free (serv[i]);
}
+ free (serv);
+
+ nis_freeresult (res);
+
return NULL;
}
@@ -141,8 +145,7 @@ nis_getservlist (const_nis_name dir)
serv[0] = NULL;
}
- if (res != NULL)
- nis_freeresult (res);
+ nis_freeresult (res);
return serv;
}