Message ID | 1384966173-6229-2-git-send-email-ssahani@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 20/11/13 11:49, Susant Sahani wrote: > Signed-off-by: Susant Sahani <ssahani@redhat.com> Committed.... steved. > --- > src/getnetconfig.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > 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); > -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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);
Signed-off-by: Susant Sahani <ssahani@redhat.com> --- src/getnetconfig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)