Permalink
Browse files

don't free gif->gif here, let Gif's dtor do it

  • Loading branch information...
1 parent 42cb392 commit c466fcac8c333ed34dafef06af729f5dd70e21ff @pkrumins pkrumins committed Aug 15, 2010
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/gif_encoder.cpp
View
@@ -131,10 +131,8 @@ gif_writer(GifFileType *gif_file, const GifByteType *data, int size)
GifImage *gif = (GifImage *)gif_file->UserData;
if (gif->size + size > gif->mem_size) {
GifByteType *new_ptr = (GifByteType *)realloc(gif->gif, gif->size + size + 10*1024);
- if (!new_ptr) {
- free(gif->gif);
+ if (!new_ptr)
throw "realloc in gif_writer failed";
- }
gif->gif = new_ptr;
gif->mem_size = gif->size + size + 10*1024;
}

0 comments on commit c466fca

Please sign in to comment.