Changeset 505


Ignore:
Timestamp:
Apr 18, 2011, 3:37:12 PM (6 years ago)
Author:
sam
Message:

cache: fix a potential crash in CacheList::unreg.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/cache.cpp

    r503 r505  
    657657void CacheList::unreg(int id)
    658658{
    659   if (list[id].file_number)
    660   {
    661     unmalloc(&list[id]);
    662     list[id].file_number=-1;
    663   }
    664   else
    665     printf("Error : trying to unregister free object\n");
     659    if (list[id].file_number >= 0)
     660    {
     661        unmalloc(&list[id]);
     662        list[id].file_number = -1;
     663    }
     664    else
     665        printf("Error : trying to unregister free object\n");
    666666}
    667667
Note: See TracChangeset for help on using the changeset viewer.