lkml.org 
[lkml]   [2013]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCHv3 20/29] tools lib traceevent: Remove malloc_or_die from plugin_function.c
> Removing malloc_or_die calls from plugin_function.c,
> replacing them and factoring the code with standard
> realloc and error path.

[SNIP]
>
> if (cpu > cpus) {
> - if (fstack)
> - fstack = realloc(fstack, sizeof(*fstack) * (cpu + 1));
> - else
> - fstack = malloc_or_die(sizeof(*fstack) * (cpu + 1));
> + fstack = realloc(fstack, sizeof(*fstack) * (cpu + 1));

This code also has same problem..

Thanks,
Namhyung


> + if (!fstack) {
> + warning("could not allocate plugin memory\n");
> + return 0;
> + }
>
> /* Account for holes in the cpu count */
> for (i = cpus + 1; i <= cpu; i++)
> --
> 1.8.3.1
>


\
 
 \ /
  Last update: 2013-11-29 12:21    [W:0.868 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site