]> granicus.if.org Git - transmission/commitdiff
(trunk libT) Fix posix_memalign() unused result warning. inspired by ijuxda's 08b0c5b
authorJordan Lee <jordan@transmissionbt.com>
Thu, 6 Jan 2011 02:17:22 +0000 (02:17 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Thu, 6 Jan 2011 02:17:22 +0000 (02:17 +0000)
libtransmission/utils.c

index 7e787de233ed266f8e5e296092e717979c5f9cec..2d4040b4ea25b9514cedfd154f26ba638513d778 100644 (file)
@@ -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 )