mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
shm: Fix socket leak on connect() error
This commit is contained in:
parent
225bc1dd0b
commit
70b8d2ab93
1 changed files with 3 additions and 5 deletions
|
@ -710,10 +710,8 @@ sp_client_open (const char *path)
|
||||||
memset (self, 0, sizeof (ShmPipe));
|
memset (self, 0, sizeof (ShmPipe));
|
||||||
|
|
||||||
self->main_socket = socket (PF_UNIX, SOCK_STREAM, 0);
|
self->main_socket = socket (PF_UNIX, SOCK_STREAM, 0);
|
||||||
if (self->main_socket < 0) {
|
if (self->main_socket < 0)
|
||||||
sp_close (self);
|
goto error;
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
sun.sun_family = AF_UNIX;
|
sun.sun_family = AF_UNIX;
|
||||||
strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
|
strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
|
||||||
|
@ -725,7 +723,7 @@ sp_client_open (const char *path)
|
||||||
return self;
|
return self;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
spalloc_free (ShmPipe, self);
|
sp_close (self);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue