mikey: Free MikeyPayload in error cases

CID #1212136
This commit is contained in:
Edward Hervey 2014-05-12 17:13:50 +02:00
parent 783195ccef
commit 464611acc4

View file

@ -1301,8 +1301,10 @@ gst_mikey_message_add_rand (GstMIKEYMessage * msg, guint8 len,
g_return_val_if_fail (len != 0 && rand != NULL, FALSE);
p = gst_mikey_payload_new (GST_MIKEY_PT_RAND);
if (!gst_mikey_payload_rand_set (p, len, rand))
if (!gst_mikey_payload_rand_set (p, len, rand)) {
gst_mikey_payload_free (p);
return FALSE;
}
return gst_mikey_message_insert_payload (msg, -1, p);
}