Merge "Fix a potential memory leak" am: f583ff660e
am: 6677429bff
Change-Id: I47d668eb5f56dd51f99415e50ff7f3ab901a18e1
This commit is contained in:
commit
6deffe3c3b
1 changed files with 7 additions and 1 deletions
|
@ -478,11 +478,17 @@ asocket* host_service_to_socket(const char* name, const char* serial) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
int fd = create_service_thread(wait_for_state, sinfo.release());
|
||||
int fd = create_service_thread(wait_for_state, sinfo.get());
|
||||
if (fd != -1) {
|
||||
sinfo.release();
|
||||
}
|
||||
return create_local_socket(fd);
|
||||
} else if (!strncmp(name, "connect:", 8)) {
|
||||
char* host = strdup(name + 8);
|
||||
int fd = create_service_thread(connect_service, host);
|
||||
if (fd == -1) {
|
||||
free(host);
|
||||
}
|
||||
return create_local_socket(fd);
|
||||
}
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue