Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
Diff: buffer.c
- Revision:
- 48:81866008bba4
- Parent:
- 30:ce3813c5a692
diff -r e59b74c745bc -r 81866008bba4 buffer.c --- a/buffer.c Thu Jul 12 18:10:56 2018 -0700 +++ b/buffer.c Tue Sep 11 11:15:08 2018 -0700 @@ -441,7 +441,7 @@ { BUFFER* b1 = (BUFFER*)handle1; BUFFER* b2 = (BUFFER*)handle2; - if (b1->buffer == NULL) + if (b1->buffer == NULL) { /* Codes_SRS_BUFFER_07_023: [BUFFER_append shall return a nonzero upon any error that is encountered.] */ result = __FAILURE__; @@ -615,6 +615,7 @@ { if (BUFFER_safemalloc(b, suppliedBuff->size) != 0) { + free(b); LogError("Failure: allocating temp buffer."); result = NULL; }