Update ooo320-m1
[ooovba.git] / applied_patches / 0034-sal-doublefree.diff
blob61c7aca09642a1dedd1e3363d2569d40bb042adc
1 Index: sal/rtl/source/alloc_cache.c
2 ===================================================================
3 RCS file: /cvs/porting/sal/rtl/source/alloc_cache.c,v
4 retrieving revision 1.2
5 diff -u -r1.2 alloc_cache.c
6 --- sal/rtl/source/alloc_cache.c 2 May 2006 12:11:54 -0000 1.2
7 +++ sal/rtl/source/alloc_cache.c 25 Jul 2006 07:57:10 -0000
8 @@ -1274,6 +1282,17 @@
9 curr = cache->m_cpu_curr;
10 if ((curr != 0) && (curr->m_mag_used < curr->m_mag_size))
12 + int i;
13 + for (i = 0; i < curr->m_mag_used; ++i)
14 + {
15 + OSL_ENSURE(curr->m_objects[i] != obj, "DOUBLE FREE!");
16 + if (curr->m_objects[i] == obj)
17 + {
18 + RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));
19 + return;
20 + }
22 + }
23 curr->m_objects[curr->m_mag_used++] = obj;
24 cache->m_cpu_stats.m_free += 1;
25 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock));