Skip to content

Commit

Permalink
Release unix_abstract_lock on error
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Jan 1, 2020
1 parent bb7c39a commit 282d53d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,14 @@ static int unix_abstract_get(const char *name, struct fd *bind_fd, uint32_t *soc
}
}

if (bind_fd != NULL && sock != NULL)
if (bind_fd != NULL && sock != NULL) {
unlock(&unix_abstract_lock);
return _EEXIST;
if (bind_fd == NULL && sock == NULL)
}
if (bind_fd == NULL && sock == NULL) {
unlock(&unix_abstract_lock);
return _ENOENT;
}

if (sock == NULL) {
sock = malloc(sizeof(struct unix_abstract));
Expand Down

0 comments on commit 282d53d

Please sign in to comment.