From: Signed-off-by: Susant Sahani Date: Fri, 22 Nov 2013 15:53:41 +0000 (-0500) Subject: __nc_error() does not check return value from malloc X-Git-Tag: libtirpc-0-2-4-rc3~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00e090f5a0741a72e7e01f52120bf5bb04e74d49;p=libtirpc __nc_error() does not check return value from malloc Signed-off-by: Susant Sahani Signed-off-by: Steve Dickson --- diff --git a/INSTALL b/INSTALL index a47e36f..8b641e3 120000 --- a/INSTALL +++ b/INSTALL @@ -1 +1 @@ -/usr/share/automake-1.12/INSTALL \ No newline at end of file +/usr/share/automake-1.13/INSTALL \ No newline at end of file diff --git a/src/getnetconfig.c b/src/getnetconfig.c index af4a484..2460a6e 100644 --- a/src/getnetconfig.c +++ b/src/getnetconfig.c @@ -146,7 +146,8 @@ __nc_error() return (&nc_error); } if ((nc_addr = (int *)thr_getspecific(nc_key)) == NULL) { - nc_addr = (int *)malloc(sizeof (int)); + if((nc_addr = (int *)malloc(sizeof (int))) == NULL) + return (&nc_error); if (thr_setspecific(nc_key, (void *) nc_addr) != 0) { if (nc_addr) free(nc_addr);