From 8572b26e129bee629a59f0aabe5f09328d49a66b Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 14 2020 09:24:35 +0000 Subject: Apply patch covscan-memory-leaks.patch patch_name: covscan-memory-leaks.patch present_in_specfile: true --- diff --git a/src/evmctl.c b/src/evmctl.c index 2ffee78..b80a1c9 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -1716,7 +1716,7 @@ static char *get_password(void) if (tcsetattr(fileno(stdin), TCSANOW, &tmp_flags) != 0) { perror("tcsetattr"); - return NULL; + goto get_pwd_err; } printf("PEM password: "); @@ -1725,10 +1725,14 @@ static char *get_password(void) /* restore terminal */ if (tcsetattr(fileno(stdin), TCSANOW, &flags) != 0) { perror("tcsetattr"); - return NULL; + goto get_pwd_err; } + free(password); return pwd; +get_pwd_err: + free(password); + return NULL; } int main(int argc, char *argv[]) diff --git a/src/libimaevm.c b/src/libimaevm.c index 6fa0ed4..39582f2 100644 --- a/src/libimaevm.c +++ b/src/libimaevm.c @@ -466,6 +466,8 @@ void init_public_keys(const char *keyfiles) entry->next = public_keys; public_keys = entry; } + + free(tmp_keyfiles); } int verify_hash_v2(const char *file, const unsigned char *hash, int size,