2004-11-10 Lutz Mueller <lutz@users.sourceforge.net>
authorLutz Mueller <lutz.s.mueller@gmail.com>
Wed, 10 Nov 2004 18:30:36 +0000 (19:30 +0100)
committerLutz Mueller <lutz.s.mueller@gmail.com>
Wed, 10 Nov 2004 18:30:36 +0000 (19:30 +0100)
* libexif/exif-data.c (exif_data_free): Fix memleak found by
  Angela Wrobel.
* contrib/watcom: Updated files contributed by Angela Wrobel.

ChangeLog
contrib/watcom/Makefile [moved from contrib/watcom/Makefile.wat with 54% similarity]
contrib/watcom/_stdint.h [moved from contrib/watcom/_stdint_watcom.h with 95% similarity]
libexif/exif-data.c

index 332df30..1b89630 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-11-10  Lutz Mueller <lutz@users.sourceforge.net>
+
+       * libexif/exif-data.c (exif_data_free): Fix memleak found by 
+         Angela Wrobel.
+       * contrib/watcom: Updated files contributed by Angela Wrobel.
+
 2004-11-03  Lutz Mueller <lutz@users.sourceforge.net>
 
        * libexif/exif-format.c: More translatable strings.
similarity index 54%
rename from contrib/watcom/Makefile.wat
rename to contrib/watcom/Makefile
index 97fe94d..2282df2 100644 (file)
@@ -1,23 +1,20 @@
 # This makefile is made for OpenWatcom/NT and runs on my system.\r
 # It should not be too hard to make it run on other systems, too.\r
 #\r
-# FIRST, rename libexif\_stdint_watcom.h to libexif\_stdint.h \r
-#\r
-# WARNING: there as no care been taken that the depencencies are\r
-# correct. This should be fixed in the future. Currently, this makefile\r
-# builds only, so after critical changes to the code, you should type\r
-# "wmake clean" before rebuilding. Sorry...\r
-#\r
-# WARNING: This makefile might run on your system, however, I made it\r
-# mainly for myself and don't want to waste my time to make it look "nice".\r
+# FIRST, move this makefile and _stdint.h to the libexif main\r
+# directory (the place where you find README and COPYING etc.)\r
 #\r
 # WARNING: I used another makefile as template, so some things might be\r
 # thrown away. Don't hesitate to improve this makefile!\r
 #\r
+# WARNING: This makefile has been made mainly for myself, I didn't\r
+# waste time to make it look "nice".\r
+#\r
 # LICENSE: no restrictions at all, but USE ON YOUR OWN RISK ONLY.\r
 #\r
-# USAGE: Simply type "wmake -f Makefile.wat" or\r
-#        rename "Makefile.wat" to "Makefile" and type "wmake"\r
+# USAGE: Simply type "wmake" or "wmake -f <makefilename>" when\r
+#        being in the libexif main directory. This makefile should\r
+#        be in that directory, too, of course.\r
 #\r
 #   Angela Wrobel <http://www.wrobelnet.de/>\r
 \r
@@ -70,6 +67,7 @@ LIBOBJECTS = &
        $(LIBEXIFDIR)\exif-data.obj $(LIBEXIFDIR)\exif-entry.obj &\r
        $(LIBEXIFDIR)\exif-format.obj $(LIBEXIFDIR)\exif-ifd.obj &\r
        $(LIBEXIFDIR)\exif-loader.obj $(LIBEXIFDIR)\exif-log.obj &\r
+       $(LIBEXIFDIR)\exif-mem.obj &\r
        $(LIBEXIFDIR)\exif-mnote-data.obj $(LIBEXIFDIR)\exif-tag.obj &\r
         $(LIBEXIFDIR)\exif-utils.obj &\r
        $(LIBEXIFDIR)\exif-mnote-data-olympus.obj &\r
@@ -92,77 +90,80 @@ libexif.lib: $(LIBOBJECTS)
        - del libexif.lib\r
        * wlib -n libexif.lib $(LIBOBJECTS)\r
 \r
-$(LIBEXIFDIR)\exif-byte-order.obj : $(LIBEXIFDIR)\exif-byte-order.c\r
+$(LIBEXIFDIR)\exif-byte-order.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-byte-order.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-content.obj : $(LIBEXIFDIR)\exif-content.c\r
+$(LIBEXIFDIR)\exif-content.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-content.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-data.obj : $(LIBEXIFDIR)\exif-data.c\r
+$(LIBEXIFDIR)\exif-data.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-data.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-entry.obj : $(LIBEXIFDIR)\exif-entry.c\r
+$(LIBEXIFDIR)\exif-entry.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-entry.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-format.obj : $(LIBEXIFDIR)\exif-format.c\r
+$(LIBEXIFDIR)\exif-format.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-format.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-ifd.obj : $(LIBEXIFDIR)\exif-ifd.c\r
+$(LIBEXIFDIR)\exif-ifd.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-ifd.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-loader.obj : $(LIBEXIFDIR)\exif-loader.c\r
+$(LIBEXIFDIR)\exif-loader.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-loader.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-log.obj : $(LIBEXIFDIR)\exif-log.c\r
+$(LIBEXIFDIR)\exif-log.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-log.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-mnote-data.obj : $(LIBEXIFDIR)\exif-mnote-data.c\r
+$(LIBEXIFDIR)\exif-mem.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-mem.c\r
+       $(CC) -c $(CFLAGS) $[*\r
+\r
+$(LIBEXIFDIR)\exif-mnote-data.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-mnote-data.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-tag.obj : $(LIBEXIFDIR)\exif-tag.c\r
+$(LIBEXIFDIR)\exif-tag.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-tag.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-utils.obj : $(LIBEXIFDIR)\exif-utils.c\r
+$(LIBEXIFDIR)\exif-utils.obj : .AUTODEPEND $(LIBEXIFDIR)\exif-utils.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-mnote-data-olympus.obj : $(LIBEXIFDIR)\olympus\exif-mnote-data-olympus.c\r
+$(LIBEXIFDIR)\exif-mnote-data-olympus.obj : .AUTODEPEND $(LIBEXIFDIR)\olympus\exif-mnote-data-olympus.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\mnote-olympus-entry.obj : $(LIBEXIFDIR)\olympus\mnote-olympus-entry.c\r
+$(LIBEXIFDIR)\mnote-olympus-entry.obj : .AUTODEPEND $(LIBEXIFDIR)\olympus\mnote-olympus-entry.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\mnote-olympus-tag.obj : $(LIBEXIFDIR)\olympus\mnote-olympus-tag.c\r
+$(LIBEXIFDIR)\mnote-olympus-tag.obj : .AUTODEPEND $(LIBEXIFDIR)\olympus\mnote-olympus-tag.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-mnote-data-pentax.obj : $(LIBEXIFDIR)\pentax\exif-mnote-data-pentax.c\r
+$(LIBEXIFDIR)\exif-mnote-data-pentax.obj : .AUTODEPEND $(LIBEXIFDIR)\pentax\exif-mnote-data-pentax.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\mnote-pentax-entry.obj : $(LIBEXIFDIR)\pentax\mnote-pentax-entry.c\r
+$(LIBEXIFDIR)\mnote-pentax-entry.obj : .AUTODEPEND $(LIBEXIFDIR)\pentax\mnote-pentax-entry.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\mnote-pentax-tag.obj : $(LIBEXIFDIR)\pentax\mnote-pentax-tag.c\r
+$(LIBEXIFDIR)\mnote-pentax-tag.obj : .AUTODEPEND $(LIBEXIFDIR)\pentax\mnote-pentax-tag.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\exif-mnote-data-canon.obj : $(LIBEXIFDIR)\canon\exif-mnote-data-canon.c\r
+$(LIBEXIFDIR)\exif-mnote-data-canon.obj : .AUTODEPEND $(LIBEXIFDIR)\canon\exif-mnote-data-canon.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\mnote-canon-entry.obj : $(LIBEXIFDIR)\canon\mnote-canon-entry.c\r
+$(LIBEXIFDIR)\mnote-canon-entry.obj : .AUTODEPEND $(LIBEXIFDIR)\canon\mnote-canon-entry.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
-$(LIBEXIFDIR)\mnote-canon-tag.obj : $(LIBEXIFDIR)\canon\mnote-canon-tag.c\r
+$(LIBEXIFDIR)\mnote-canon-tag.obj : .AUTODEPEND $(LIBEXIFDIR)\canon\mnote-canon-tag.c\r
        $(CC) -c $(CFLAGS) $[*  \r
 \r
 \r
-test-mem.exe : $(TESTEXIFDIR)\test-mem.c\r
+test-mem.exe : .AUTODEPEND $(TESTEXIFDIR)\test-mem.c\r
        $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib\r
 \r
-test-mnote.exe : $(TESTEXIFDIR)\test-mnote.c\r
+test-mnote.exe : .AUTODEPEND $(TESTEXIFDIR)\test-mnote.c\r
        $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib\r
 \r
-test-tree.exe : $(TESTEXIFDIR)\test-tree.c\r
+test-tree.exe : .AUTODEPEND $(TESTEXIFDIR)\test-tree.c\r
        $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib\r
 \r
-test-value.exe : $(TESTEXIFDIR)\test-value.c\r
+test-value.exe : .AUTODEPEND $(TESTEXIFDIR)\test-value.c\r
        $(CC) $(CFLAGS) $(LDFRLAGS) $< libexif.lib\r
 \r
 \r
similarity index 95%
rename from contrib/watcom/_stdint_watcom.h
rename to contrib/watcom/_stdint.h
index 7e95556..60ab875 100644 (file)
@@ -1,11 +1,11 @@
-/* This file is generated automatically by configure */
-#ifndef __STDINT_H
-#define __STDINT_H
-#include <sys/types.h>
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
-typedef signed long int32_t;
-#endif
-
-
+/* This file is generated automatically by configure */\r
+#ifndef __STDINT_H\r
+#define __STDINT_H\r
+#include <sys/types.h>\r
+typedef unsigned char uint8_t;\r
+typedef unsigned short uint16_t;\r
+typedef unsigned long uint32_t;\r
+typedef signed long int32_t;\r
+#endif\r
+\r
+\r
index 77b363f..6d9832a 100644 (file)
@@ -811,6 +811,7 @@ void
 exif_data_free (ExifData *data)
 {
        unsigned int i;
+       ExifMem *mem = (data && data->priv) ? data->priv->mem : NULL;
 
        if (!data) return;
 
@@ -821,20 +822,21 @@ exif_data_free (ExifData *data)
                }
        }
 
+       if (data->data) {
+               exif_mem_free (mem, data->data);
+               data->data = NULL;
+       }
+
        if (data->priv) {
-               ExifMem *mem = data->priv->mem;
-               if (data->data) {
-                       exif_mem_free (data->priv->mem, data->data);
-                       data->data = NULL;
-               }
                if (data->priv->md) {
                        exif_mnote_data_unref (data->priv->md);
                        data->priv->md = NULL;
                }
                exif_mem_free (mem, data->priv);
                exif_mem_free (mem, data);
-               exif_mem_unref (mem);
        }
+
+       exif_mem_unref (mem);
 }
 
 void