From: Mateusz Moscicki Date: Wed, 14 Sep 2022 13:36:39 +0000 (+0200) Subject: Fix resource leak X-Git-Tag: accepted/tizen/unified/20220915.015345^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28f46024c2855b850b8e7e3c406f8de8c5b1dc4a;p=platform%2Fcore%2Fsystem%2Fupdate-control.git Fix resource leak Change-Id: Ib88c81676a741083fcc95289cb690db09564d75e --- diff --git a/update-manager/common/common-util.c b/update-manager/common/common-util.c index 38aa840..43a0a3f 100644 --- a/update-manager/common/common-util.c +++ b/update-manager/common/common-util.c @@ -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);