mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 16:51:10 +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));
|
||||
|
||||
self->main_socket = socket (PF_UNIX, SOCK_STREAM, 0);
|
||||
if (self->main_socket < 0) {
|
||||
sp_close (self);
|
||||
return NULL;
|
||||
}
|
||||
if (self->main_socket < 0)
|
||||
goto error;
|
||||
|
||||
sun.sun_family = AF_UNIX;
|
||||
strncpy (sun.sun_path, path, sizeof (sun.sun_path) - 1);
|
||||
|
@ -725,7 +723,7 @@ sp_client_open (const char *path)
|
|||
return self;
|
||||
|
||||
error:
|
||||
spalloc_free (ShmPipe, self);
|
||||
sp_close (self);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue