Patch by Takuro Ashie <makeinu@users.sourceforge.net>:
* libexif/exif-data.c: Plug memory leak.
+2002-07-25 Lutz Müller <lutz@users.sourceforge.net>
+
+ Patch by Takuro Ashie <makeinu@users.sourceforge.net>:
+
+ * libexif/exif-data.c: Plug memory leak.
+
2002-07-10 Lutz Müller <lutz@users.sourceforge.net>
Bug spotted by Andres <aplaza@smalcamera.com>:
void
exif_data_free (ExifData *data)
{
- if (data->ifd0)
+ if (!data)
+ return;
+
+ if (data->ifd0) {
exif_content_unref (data->ifd0);
- if (data->ifd1)
+ data->ifd0 = NULL;
+ }
+ if (data->ifd1) {
exif_content_unref (data->ifd1);
- if (data->data)
+ data->ifd1 = NULL;
+ }
+ if (data->ifd_exif) {
+ exif_content_unref (data->ifd_exif);
+ data->ifd_exif = NULL;
+ }
+ if (data->ifd_gps) {
+ exif_content_unref (data->ifd_gps);
+ data->ifd_gps = NULL;
+ }
+ if (data->ifd_interoperability) {
+ exif_content_unref (data->ifd_interoperability);
+ data->ifd_interoperability = NULL;
+ }
+ if (data->data) {
free (data->data);
- free (data->priv);
+ data->data = NULL;
+ }
+ if (data->priv) {
+ free (data->priv);
+ data->priv = NULL;
+ }
free (data);
}