summaryrefslogtreecommitdiff
path: root/src/getnetconfig.c
diff options
context:
space:
mode:
authorSigned-off-by: Susant Sahani <ssahani@redhat.com>2013-11-22 10:53:41 -0500
committerSteve Dickson <steved@redhat.com>2013-11-25 14:10:49 -0500
commit00e090f5a0741a72e7e01f52120bf5bb04e74d49 (patch)
tree22fc1d9b54f7bafbada2f378461928433cd3a9a1 /src/getnetconfig.c
parent6310d24b23bd8a85799153b08d506d413a0db7af (diff)
downloadti-rpc-00e090f5a0741a72e7e01f52120bf5bb04e74d49.tar.gz
__nc_error() does not check return value from malloc
Signed-off-by: Susant Sahani <ssahani@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'src/getnetconfig.c')
-rw-r--r--src/getnetconfig.c3
1 files changed, 2 insertions, 1 deletions
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);