trivial: Fix a tiny memory leak when writing DfuSe images

Found using Coverity, many thanks.
This commit is contained in:
Richard Hughes 2017-05-08 20:32:15 +01:00
parent df5652ffb5
commit dc3856b51d

View File

@ -282,7 +282,7 @@ dfu_firmware_to_dfuse (DfuFirmware *firmware, GError **error)
guint i;
guint32 image_size_total = 0;
guint32 offset = sizeof (DfuSePrefix);
guint8 *buf;
g_autofree guint8 *buf = NULL;
g_autoptr(GPtrArray) dfuse_images = NULL;
/* get all the image data */
@ -325,7 +325,7 @@ dfu_firmware_to_dfuse (DfuFirmware *firmware, GError **error)
}
/* return blob */
return g_bytes_new_take (buf, sizeof (DfuSePrefix) + image_size_total);
return g_bytes_new (buf, sizeof (DfuSePrefix) + image_size_total);
}
/**