am 072a0fac
: Merge "Fixed adb crash due to accessing freed memory"
* commit '072a0fac3cabd50c2089d987b5abceac35c74570': Fixed adb crash due to accessing freed memory
This commit is contained in:
commit
eafcbe109f
1 changed files with 5 additions and 2 deletions
|
@ -221,10 +221,12 @@ static void local_socket_close_locked(asocket *s)
|
|||
if(s->peer) {
|
||||
s->peer->peer = 0;
|
||||
// tweak to avoid deadlock
|
||||
if (s->peer->close == local_socket_close)
|
||||
if (s->peer->close == local_socket_close) {
|
||||
local_socket_close_locked(s->peer);
|
||||
else
|
||||
} else {
|
||||
s->peer->close(s->peer);
|
||||
}
|
||||
s->peer = 0;
|
||||
}
|
||||
|
||||
/* If we are already closing, or if there are no
|
||||
|
@ -782,6 +784,7 @@ static void smart_socket_close(asocket *s)
|
|||
if(s->peer) {
|
||||
s->peer->peer = 0;
|
||||
s->peer->close(s->peer);
|
||||
s->peer = 0;
|
||||
}
|
||||
free(s);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue