int i = 0, seqlen = sdp_list_len(profiles);
void **seqDTDs, **seqs;
const sdp_list_t *p;
+ sdp_data_t *pAPSeq;
seqDTDs = malloc(seqlen * sizeof(void *));
if (!seqDTDs)
sdp_profile_desc_t *profile = p->data;
if (!profile) {
status = -1;
- break;
+ goto end;
}
switch (profile->uuid.type) {
case SDP_UUID16:
break;
default:
status = -1;
- break;
+ goto end;
}
dtds[1] = &uint16;
values[1] = &profile->version;
if (seq == NULL) {
status = -1;
- break;
+ goto end;
}
seqDTDs[i] = &seq->dtd;
sdp_pattern_add_uuid(rec, &profile->uuid);
i++;
}
- if (status == 0) {
- sdp_data_t *pAPSeq = sdp_seq_alloc(seqDTDs, seqs, seqlen);
- sdp_attr_add(rec, SDP_ATTR_PFILE_DESC_LIST, pAPSeq);
- }
+
+ pAPSeq = sdp_seq_alloc(seqDTDs, seqs, seqlen);
+ sdp_attr_add(rec, SDP_ATTR_PFILE_DESC_LIST, pAPSeq);
+end:
free(seqDTDs);
free(seqs);
return status;