summaryrefslogtreecommitdiff
path: root/utility/verify_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility/verify_data.c')
-rw-r--r--utility/verify_data.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/utility/verify_data.c b/utility/verify_data.c
index 95c1bbd5..ed4bcc16 100644
--- a/utility/verify_data.c
+++ b/utility/verify_data.c
@@ -38,13 +38,16 @@ uint8_t* read_signature(char* input_file, int len) {
/* Read the signature into a buffer*/
signature = (uint8_t*) malloc(len);
- if (!signature)
+ if (!signature) {
+ close(sigfd);
return NULL;
+ }
if( (i = read(sigfd, signature, len)) != len ) {
fprintf(stderr, "Wrong signature length - Expected = %d, Received = %d\n",
len, i);
close(sigfd);
+ free(signature);
return NULL;
}