Hi All,
I find a memory leak about gpt_update_pt_crc function and I try to fix it.
Cheers,
Manuele
=== modified file 'uspace/lib/label/src/gpt.c'
--- uspace/lib/label/src/gpt.c 2016-03-15 15:05:13 +0000
+++ uspace/lib/label/src/gpt.c 2016-06-16 11:02:46 +0000
@@ -918,7 +918,7 @@
gpt_hdr = calloc(1, label->block_size);
if (gpt_hdr == NULL) {
rc = ENOMEM;
- goto error;
+ goto exit;
}
for (i = 0; i < 2; i++) {
@@ -926,7 +926,7 @@
label->lt.gpt.hdr_ba[i], 1, gpt_hdr);
if (rc != EOK) {
rc = EIO;
- goto error;
+ goto exit;
}
gpt_hdr->pe_array_crc32 = host2uint32_t_le(crc);
@@ -936,13 +936,13 @@
label->lt.gpt.hdr_ba[i], 1, gpt_hdr);
if (rc != EOK) {
rc = EIO;
- goto error;
+ goto exit;
}
}
+ rc = EOK;
+exit:
free(gpt_hdr);
- return EOK;
-error:
return rc;
}
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel