mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
sctp: Fix crash on free() when using the MSVC binaries
On Windows, if libusrsctp and gstreamer are built with different C runtimes (CRT), we cannot free memory allocated inside libusrsctp with the `free()` function from gstreamer's CRT. `usrsctp_freedumpbuffer()` simply calls `free()`, but because of the way DLLs work on Windows, it will always call the free function from the correct CRT.
This commit is contained in:
parent
062ca5e55b
commit
70a90f0e5e
1 changed files with 5 additions and 1 deletions
|
@ -686,7 +686,11 @@ receive_cb (struct socket *sock, union sctp_sockstore addr, void *data,
|
|||
if (flags & MSG_NOTIFICATION) {
|
||||
handle_notification (self, (const union sctp_notification *) data,
|
||||
datalen);
|
||||
free (data);
|
||||
/* We use this instead of a bare `free()` so that we use the `free` from
|
||||
* the C runtime that usrsctp was built with. This makes a difference on
|
||||
* Windows where libusrstcp and GStreamer can be linked to two different
|
||||
* CRTs. */
|
||||
usrsctp_freedumpbuffer (data);
|
||||
} else {
|
||||
handle_message (self, data, datalen, rcv_info.rcv_sid,
|
||||
ntohl (rcv_info.rcv_ppid));
|
||||
|
|
Loading…
Reference in a new issue