if (type == BUNDLE_TYPE_STR) {
bundle_keyval_get_basic_val((bundle_keyval_t *) kv, &ptr, &size);
buff = malloc(sizeof(char) * size + 1);
+ if (buff == NULL) {
+ WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to allocate memory");
+ __WFD_APP_FUNC_EXIT__;
+ return;
+ }
snprintf(buff, size + 1, "%s", ((char*) ptr));
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size);
} else if (type == BUNDLE_TYPE_BYTE) {
bundle_keyval_get_basic_val((bundle_keyval_t *) kv, &ptr, &size);
buff = malloc(sizeof(char) * size + 1);
+ if (buff == NULL) {
+ WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to allocate memory");
+ __WFD_APP_FUNC_EXIT__;
+ return;
+ }
snprintf(buff, size + 1, "%s", ((char*) ptr));
WFD_APP_LOG(WFD_APP_LOG_ERROR, "Found STR -KEY: %s, VAL: %s, SIZE: %d", key, buff, size);