Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ba5a8ac authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am eafcbe10: am 072a0fac: Merge "Fixed adb crash due to accessing freed memory"

* commit 'eafcbe10':
  Fixed adb crash due to accessing freed memory
parents 716104b4 eafcbe10
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -221,11 +221,13 @@ 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
        ** pending packets, destroy immediately
@@ -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);
}