src/gui/opkg_manager.cpp fix esource leak; supplement to 6e321d5966

Origin commit data
------------------
Branch: ni/coolstream
Commit: 18e1ec060f
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-07-01 (Sat, 01 Jul 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2017-07-01 10:26:33 +02:00
parent 1c9ce40eb4
commit 9473eabf2a
2 changed files with 4 additions and 3 deletions

View File

@@ -674,9 +674,10 @@ string COPKGManager::getPkgDescription(std::string pkgName, std::string pkgDesc)
fseek(fd, 0, SEEK_END);
fgetpos(fd, &fz);
fseek(fd, 0, SEEK_SET);
if (fz.__pos == 0)
if (fz.__pos == 0){
fclose(fd);
return pkgDesc;
}
char buf[512];
string package, version, description;
while (fgets(buf, sizeof(buf), fd)) {