ndef: Support unknown MIME types
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 6 Feb 2012 15:04:31 +0000 (16:04 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 6 Feb 2012 15:04:31 +0000 (16:04 +0100)
Unknown MIME types are left without parsing.

src/ndef.c

index 16cfb52..f0b6831 100644 (file)
@@ -464,6 +464,9 @@ static void free_sp_record(struct near_ndef_sp_record *sp)
 
 static void free_mime_record(struct near_ndef_mime_record *mime)
 {
+       if (mime == NULL)
+               return;
+
        g_free(mime->type);
        g_free(mime);
 
@@ -1181,8 +1184,6 @@ parse_mime_type(struct near_ndef_record *record,
        } else if (strcmp(mime->type, "nokia.com:bt") == 0) {
                err = __near_bt_parse_oob_record(BT_MIME_V2_0,
                                &ndef_data[offset]);
-       } else {
-               err = -EOPNOTSUPP;
        }
 
        if (err < 0) {