rnd-20140307-1-src
[rocksndiamonds.git] / src / libgame / gadgets.c
index 3781aeb416c1497163820c819992baad3fb222bd..8b99078ebfd62d3963eaa65777eee631192b0ccc 100644 (file)
@@ -1263,6 +1263,9 @@ void FreeGadget(struct GadgetInfo *gi)
 {
   struct GadgetInfo *gi_previous = gadget_list_first_entry;
 
+  if (gi == NULL)
+    return;
+
   /* prevent "last_info_gi" from pointing to memory that will be freed */
   if (last_info_gi == gi)
     last_info_gi = NULL;