OSDN Git Service

自動拾いファイルに重複するエントリがあった時にメモリリークしていたのを修正。
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 13 Jan 2010 09:23:32 +0000 (09:23 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 13 Jan 2010 09:23:32 +0000 (09:23 +0000)
src/autopick.c

index 7c47979..50efa1c 100644 (file)
@@ -870,7 +870,11 @@ errr process_autopick_file_command(char *buf)
                   && entry->flag[0] == autopick_list[i].flag[0]
                   && entry->flag[1] == autopick_list[i].flag[1]
                   && entry->dice == autopick_list[i].dice
-                  && entry->bonus == autopick_list[i].bonus) return 0;
+                  && entry->bonus == autopick_list[i].bonus)
+               {
+                       autopick_free_entry(entry);
+                       return 0;
+               }
 
        add_autopick_list(entry);
        return 0;