From 6353a1ff2455244b4bd85516108126f88f5eda6f Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 9 May 2009 20:01:31 +0000 Subject: also close any open stream on buffer error git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@879 ef36b2f9-881f-0410-afb5-c4e39611909c --- nss/common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nss/common.h b/nss/common.h index 377903b..3d2de88 100644 --- a/nss/common.h +++ b/nss/common.h @@ -175,6 +175,13 @@ TFILE *nslcd_client_open(void) /* check that we have a valid buffer */ \ if ((buffer==NULL)||(buflen<=0)) \ { \ + /* close stream */ \ + if (fp!=NULL) \ + { \ + (void)tio_close(fp); \ + fp=NULL; \ + } \ + /* indicate error */ \ *errnop=EINVAL; \ return NSS_STATUS_UNAVAIL; \ } \ -- cgit v1.2.3-54-g00ecf