Fix resource leak 34/281234/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.062955 accepted/tizen/7.0/unified/hotfix/20221116.105832 accepted/tizen/unified/20220915.015345 accepted/tizen/unified/20220915.023908 accepted/tizen/unified/20220915.025948 tizen_7.0_m2_release
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 14 Sep 2022 13:36:39 +0000 (15:36 +0200)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Wed, 14 Sep 2022 13:36:39 +0000 (15:36 +0200)
Change-Id: Ib88c81676a741083fcc95289cb690db09564d75e

update-manager/common/common-util.c

index 38aa8405bb88ac99d247722fd68e38b8945d2ecd..43a0a3fc258d00e3931b1526baf42794d84c2bf6 100644 (file)
@@ -186,6 +186,8 @@ static int calculate_checksum(const char *file_path, char *sha1_hex, size_t sha1
        while ((bytes = read(file_fd, buf, sizeof(buf))) > 0)
                SHA1Update(&context, buf, bytes);
 
+       close(file_fd);
+
        unsigned char sha1[SHA1_LEN * 2 + 1];
        SHA1Final(sha1, &context);