summaryrefslogtreecommitdiff
path: root/src/ndef.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ndef.c')
-rw-r--r--src/ndef.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/ndef.c b/src/ndef.c
index a39ad36..75fa881 100644
--- a/src/ndef.c
+++ b/src/ndef.c
@@ -1415,23 +1415,25 @@ parse_mime_type(struct near_ndef_record *record, uint8_t *ndef_data,
data.state = CPS_UNKNOWN;
if (__near_agent_handover_registered() == TRUE) {
- if (action == TRUE)
+ if (action == TRUE) {
err = __near_agent_handover_push_data(&data);
- else if (reply != NULL)
+ } else if (reply != NULL) {
*reply = near_ndef_prepare_handover_record("Hs",
record, NEAR_CARRIER_BLUETOOTH, &data);
+ if (*reply == NULL)
+ err = -ENOMEM;
+ }
} else {
err = __near_bluetooth_parse_oob_record(&data,
&mime->handover.properties, action);
- if (err == 0 && reply != NULL)
+ if (err == 0 && reply != NULL) {
*reply = near_ndef_prepare_handover_record("Hs",
record, NEAR_CARRIER_BLUETOOTH, NULL);
+ if (*reply == NULL)
+ err = -ENOMEM;
+ }
}
- /* check if requested reply message was created successfully */
- if (reply != NULL && *reply == NULL)
- err = -ENOMEM;
-
done:
if (err < 0) {
DBG("Parsing mime error %d", err);