modules: unset buffer and size after alloc failure

Set the buffer_data to NULL and the size to 0 after we free the
buffer in realloc failure to avoid problems later.
This commit is contained in:
Wim Taymans 2026-05-01 13:02:00 +02:00
parent a4fb06073c
commit ceb80723a9

View file

@ -144,6 +144,8 @@ static void *connection_ensure_size(struct pw_protocol_native_connection *conn,
if (np == NULL) {
res = -errno;
free(buf->buffer_data);
buf->buffer_data = NULL;
buf->buffer_size = 0;
buf->buffer_maxsize = 0;
spa_hook_list_call(&conn->listener_list,
struct pw_protocol_native_connection_events,