Skip to content

Commit

Permalink
Set pointers to freed memory to NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
rmagick committed Nov 25, 2007
1 parent c8957bd commit 28c7e83
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/RMagick/rmdraw.c
@@ -1,4 +1,4 @@
/* $Id: rmdraw.c,v 1.43.2.2 2007/04/13 00:13:56 rmagick Exp $ */
/* $Id: rmdraw.c,v 1.43.2.2.2.1 2007/11/25 19:42:42 rmagick Exp $ */
/*============================================================================\
| Copyright (C) 2007 by Timothy P. Hunter
| Name: rmdraw.c
Expand Down Expand Up @@ -855,6 +855,7 @@ destroy_Draw(void *drawptr)
if (draw->info)
{
(void) DestroyDrawInfo(draw->info);
draw->info = NULL;
}

// Erase any temporary image files.
Expand Down Expand Up @@ -1186,10 +1187,12 @@ destroy_Montage(void *obj)
if (montage->info && montage->info->texture != NULL)
{
rm_delete_temp_image(montage->info->texture);
montage->info->texture = NULL;
}
if (montage->info)
{
(void) DestroyMontageInfo(montage->info);
montage->info = NULL;
}
xfree(montage);
}
Expand Down

0 comments on commit 28c7e83

Please sign in to comment.