'sum' is free'd when it is not in use anymore
Signed-off-by: Imran Zaman <imran.zaman@intel.com>
Change-Id: I3add11bc32bc496bd0b1069310a60245cdac77d0
term = ';';
for (key = keys ; key != NULL ; key = key->next) {
status = sha256sum_add_data(sum, key->name, strlen(key->name));
- if (status < 0)
+ if (status < 0) {
+ sha256sum_destroy(sum);
return status;
+ }
status = sha256sum_add_data(sum, &term, 1);
- if (status < 0)
+ if (status < 0) {
+ sha256sum_destroy(sum);
return status;
+ }
}
status = sha256sum_get(sum, signup);
+ sha256sum_destroy(sum);
if (status < 0)
return status;