msvcrt: Fix double-free and memory leak in type_info destructor.
Spotted by toying with the gcc's static analyzer. Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6c64e6dee4
commit
01111b941d
|
@ -457,7 +457,7 @@ void * __thiscall type_info_vector_dtor(type_info * _this, unsigned int flags) \
|
||||||
/* we have an array, with the number of elements stored before the first object */ \
|
/* we have an array, with the number of elements stored before the first object */ \
|
||||||
INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
|
INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
|
||||||
\
|
\
|
||||||
for (i = *ptr - 1; i >= 0; i--) free(_this->name); \
|
for (i = *ptr - 1; i >= 0; i--) free(_this[i].name); \
|
||||||
free(ptr); \
|
free(ptr); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
|
|
|
@ -291,7 +291,7 @@ void * __thiscall type_info_vector_dtor(type_info * _this, unsigned int flags) \
|
||||||
/* we have an array, with the number of elements stored before the first object */ \
|
/* we have an array, with the number of elements stored before the first object */ \
|
||||||
INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
|
INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
|
||||||
\
|
\
|
||||||
for (i = *ptr - 1; i >= 0; i--) free(_this->name); \
|
for (i = *ptr - 1; i >= 0; i--) free(_this[i].name); \
|
||||||
free(ptr); \
|
free(ptr); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
|
|
Loading…
Reference in New Issue