If ctx == NULL, then VERIFY_NON_NULL would goto exit, which would then
OCFree the uninitialized variables.
Found by Clang:
occoap.c:274:5: warning: variable 'rcvObserveOption' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
occoap.c:44:36: note: expanded from macro 'VERIFY_NON_NULL'
#define VERIFY_NON_NULL(arg) { if (!arg) {OC_LOG_V(FATAL, TAG, "%s is NULL", #arg); goto exit;} }
^~~~
occoap.c:459:16: note: uninitialized use occurs here
--Erich: rebase on master
Change-Id: Ie829c6ac284dfd988eeeffad446d9872424e604a
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
OCClientResponse * clientResponse = NULL;
ClientCB * cbNode = NULL;
unsigned char * bufRes = NULL;
- uint8_t * rcvObserveOption;
- uint8_t * rcvMaxAgeOption;
+ uint8_t * rcvObserveOption = NULL;
+ uint8_t * rcvMaxAgeOption = NULL;
uint32_t sequenceNumber = 0;
uint32_t maxAge = 0;
OCStackResult result = OC_STACK_ERROR;