Fixed always-true condition

This commit is contained in:
Ivan Skytte Jørgensen
2016-02-29 16:42:58 +01:00
parent 1838911c60
commit b9ec4ab9bb

@ -1807,7 +1807,6 @@ char *serializeMsg2 ( void *thisPtr ,
int32_t *retSize ) {
// make a buffer to serialize into
char *buf = NULL;
int32_t baseSize = (char *)firstStrPtr - (char *)thisPtr;
int nptrs=((char *)firstSizeParm-(char *)firstStrPtr)/sizeof(char *);
int32_t need = baseSize;
@ -1824,8 +1823,8 @@ char *serializeMsg2 ( void *thisPtr ,
}
int32_t stringBufferOffset = need;
need += totalStringSizes;
// alloc if we should
if ( ! buf ) buf = (char *)mmalloc ( need , "sm2" );
// alloc serialization buffer
char *buf = (char *)mmalloc ( need , "sm2" );
// bail on error, g_errno should be set
if ( ! buf ) return NULL;
// set how many bytes we will serialize into