Em Wed, Dec 16, 2015 at 09:37:18AM +0800, Wangnan (F) escreveu:
>
>
> On 2015/12/15 20:36, Jiri Olsa wrote:
> >On Mon, Dec 14, 2015 at 10:39:11AM +, Wang Nan wrote:
> >
> >SNIP
> >
> >>@@ -137,12 +138,15 @@ void machine__exit(struct machine *machine)
> >> void machine__delete(struct machine
On 2015/12/15 20:36, Jiri Olsa wrote:
On Mon, Dec 14, 2015 at 10:39:11AM +, Wang Nan wrote:
SNIP
@@ -137,12 +138,15 @@ void machine__exit(struct machine *machine)
void machine__delete(struct machine *machine)
{
machine__exit(machine);
- free(machine);
+ if (machin
On Mon, Dec 14, 2015 at 10:39:11AM +, Wang Nan wrote:
SNIP
> @@ -137,12 +138,15 @@ void machine__exit(struct machine *machine)
> void machine__delete(struct machine *machine)
> {
> machine__exit(machine);
> - free(machine);
> + if (machine->allocated)
> + free(mach
To prevent futher commits calling machine__delete() on non-allocated
'struct machine' (which would cause memory corruption), this patch
enforces machine__init(), record whether a machine structure is
dynamically allocated or not, and warn if machine__delete() is called
on incorrect object.
Signed-
4 matches
Mail list logo