From: Garrett Wollman Date: Sun, 15 Jul 2012 18:18:12 +0000 (-0400) Subject: budb: don't malloc(0) on error condition in GetText() X-Git-Tag: upstream/1.8.0_pre1^2~2221 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f4b2ad4dc974b441819d0113efbb81c537b8ed97;p=packages%2Fo%2Fopenafs.git budb: don't malloc(0) on error condition in GetText() malloc(0) is non-portable (may return a pointer to no space, or it may return NULL. Just set the result to NULL without bothering to call malloc(), as is done earlier in this function. Change-Id: Ic3562e722113a1409ec7c30bd571e9470b3e092b Reviewed-on: http://gerrit.openafs.org/7766 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/budb/db_text.c b/src/budb/db_text.c index 4e58195f6..1d1a3b4a9 100644 --- a/src/budb/db_text.c +++ b/src/budb/db_text.c @@ -177,7 +177,7 @@ GetText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType, no_xfer_abort: charListPtr->charListT_len = 0; - charListPtr->charListT_val = malloc(0); + charListPtr->charListT_val = NULL; abort_exit: if (ut)