From 4a2e6c47e3c08c7261105ec68585ede2e1ec3243 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rg=20Hoh?= Date: Sun, 16 May 2004 16:06:37 +0200 Subject: [PATCH] added error handling on realloc added a missing realloc when removing entries --- libexif/exif-content.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libexif/exif-content.c b/libexif/exif-content.c index fbbbe49..bb720dc 100644 --- a/libexif/exif-content.c +++ b/libexif/exif-content.c @@ -109,6 +109,8 @@ exif_content_add_entry (ExifContent *content, ExifEntry *entry) entry->parent = content; content->entries = realloc (content->entries, sizeof (ExifEntry) * (content->count + 1)); + if (!content->entries) + return; content->entries[content->count] = entry; exif_entry_ref (entry); content->count++; @@ -132,6 +134,7 @@ exif_content_remove_entry (ExifContent *c, ExifEntry *e) c->count--; e->parent = NULL; exif_entry_unref (e); + c->entries = realloc(c->entries,sizeof(ExifEntry) * c->count); } ExifEntry * -- 2.7.4