• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revisiónf6d51cd8143a3e7f64321b8df6120498057e58b7 (tree)
Tiempo2016-09-04 08:47:15
AutorJosh Gao <jmgao@goog...>
CommiterSteve Kondik

Log Message

adb: fix fd leak when shell fails to create a thread.

Bug: http://b/29565233
Change-Id: Ia59c6dbe5ac033425c11739579e85cbcad1170d1

Cambiar Resumen

Diferencia incremental

--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -778,13 +778,14 @@ int StartSubprocess(const char* name, const char* terminal_type,
778778 return ReportError(protocol, error);
779779 }
780780
781- int local_socket = subprocess->ReleaseLocalSocket();
782- D("subprocess creation successful: local_socket_fd=%d, pid=%d", local_socket, subprocess->pid());
781+ unique_fd local_socket(subprocess->ReleaseLocalSocket());
782+ D("subprocess creation successful: local_socket_fd=%d, pid=%d", local_socket.get(),
783+ subprocess->pid());
783784
784785 if (!Subprocess::StartThread(std::move(subprocess), &error)) {
785786 LOG(ERROR) << "failed to start subprocess management thread: " << error;
786787 return ReportError(protocol, error);
787788 }
788789
789- return local_socket;
790+ return local_socket.release();
790791 }