From 35cf5e4a321fa2761048e01bf2d38dbf1a8b020e Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Thu, 6 Jan 2011 02:17:22 +0000 Subject: [PATCH] (trunk libT) Fix posix_memalign() unused result warning. inspired by ijuxda's 08b0c5b --- libtransmission/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 7e787de23..2d4040b4e 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -1624,7 +1624,8 @@ tr_valloc( size_t bufLen ) #ifdef HAVE_POSIX_MEMALIGN if( !buf ) - posix_memalign( &buf, pageSize, allocLen ); + if( posix_memalign( &buf, pageSize, allocLen ) ) + buf = NULL; /* just retry with valloc/malloc */ #endif #ifdef HAVE_VALLOC if( !buf )