• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

system/core


Commit MetaInfo

Révision656154a5b4127370f7317852e224a9121c6beed3 (tree)
l'heure2016-11-13 21:03:50
AuteurMichael W <baddaemon87@gmai...>
CommiterMichael W

Message de Log

init: Fix possible open file pointer

In error case the file is not closed properly.
Add close() before return

Change-Id: Ie1755987859a576045c786105404957d94f0b39d

Change Summary

Modification

--- a/init/init.cpp
+++ b/init/init.cpp
@@ -1012,8 +1012,10 @@ static int charging_mode_booting(void) {
10121012 if (f < 0)
10131013 return 0;
10141014
1015- if (1 != read(f, (void *)&cmb,1))
1015+ if (1 != read(f, (void *)&cmb,1)) {
1016+ close(f);
10161017 return 0;
1018+ }
10171019
10181020 close(f);
10191021 return ('1' == cmb);