* libio/fmemopen.c (fmemopen): Free stream memory in case of
[platform/upstream/glibc.git] / nis / nss_nisplus / nisplus-ethers.c
index ca0a9e2..8b628fc 100644 (file)
@@ -261,17 +261,18 @@ _nss_nisplus_gethostton_r (const char *name, struct etherent *eth,
 
   int parse_res = _nss_nisplus_parse_etherent (result, eth, buffer,
                                               buflen, errnop);
+
+  /* We do not need the lookup result anymore.  */
+  nis_freeresult (result);
+
   if (__builtin_expect (parse_res < 1, 0))
     {
       __set_errno (olderr);
 
       if (parse_res == -1)
-       {
-         nis_freeresult (result);
-         return NSS_STATUS_TRYAGAIN;
-       }
-      else
-       return NSS_STATUS_NOTFOUND;
+       return NSS_STATUS_TRYAGAIN;
+
+      return NSS_STATUS_NOTFOUND;
     }
 
   return NSS_STATUS_SUCCESS;
@@ -326,13 +327,14 @@ _nss_nisplus_getntohost_r (const struct ether_addr *addr, struct etherent *eth,
 
   int parse_res = _nss_nisplus_parse_etherent (result, eth, buffer,
                                               buflen, errnop);
+
+  /* We do not need the lookup result anymore.  */
+  nis_freeresult (result);
+
   if (__builtin_expect (parse_res < 1, 0))
     {
       if (parse_res == -1)
-       {
-         nis_freeresult (result);
-         return NSS_STATUS_TRYAGAIN;
-       }
+       return NSS_STATUS_TRYAGAIN;
 
       return NSS_STATUS_NOTFOUND;
     }