Fix use of uninitialized variable
authorErich Keane <erich.keane@intel.com>
Thu, 11 Sep 2014 17:57:44 +0000 (10:57 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 11 Sep 2014 17:57:44 +0000 (10:57 -0700)
commit47306784d04a2d90bf02e121f5166d2f7c6b8740
treec327df37d7730a35d38a655c5735f02f7da0023c
parent49cf38ab98c9c222ed4f26b60f0463e9865ebbbf
Fix use of uninitialized variable

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>
csdk/occoap/src/occoap.c