fix g_malloc usage on non-Linux platforms (patch by Benoit Dejean
2004-03-09 Bastien Nocera <hadess@hadess.net> * fix g_malloc usage on non-Linux platforms (patch by Benoit Dejean <bnet@ifrance.com>)
This commit is contained in:
committed by
Bastien Nocera
parent
58c15ceeda
commit
a795ff4847
@@ -1,3 +1,9 @@
|
||||
2004-03-09 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* procargs.c: (glibtop_get_proc_args_s):
|
||||
* procmap.c: (glibtop_get_proc_map_s): fix g_malloc usage on non-Linux
|
||||
platforms (patch by Benoit Dejean <bnet@ifrance.com>)
|
||||
|
||||
2003-10-21 Bastien Nocera <hadess@hadess.net>
|
||||
|
||||
* Makefile.am: install only one library, libgtop-2.0
|
||||
|
||||
@@ -60,7 +60,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
|
||||
break;
|
||||
if(max_len)
|
||||
{
|
||||
ret = g_malloc(server, max_len + 1);
|
||||
ret = g_malloc(max_len + 1);
|
||||
if(max_len < len)
|
||||
len = max_len;
|
||||
memcpy(ret, pinfo.pr_psargs, len);
|
||||
@@ -68,7 +68,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = g_malloc(server, len + 1);
|
||||
ret = g_malloc(len + 1);
|
||||
memcpy(ret, pinfo.pr_psargs, len);
|
||||
ret[len] = 0;
|
||||
|
||||
|
||||
@@ -120,8 +120,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
if(!(entry = g_malloc(server,
|
||||
nmaps * sizeof(glibtop_map_entry))))
|
||||
if(!(entry = g_malloc(nmaps * sizeof(glibtop_map_entry))))
|
||||
return NULL;
|
||||
buf->number = nmaps;
|
||||
buf->size = sizeof(glibtop_map_entry);
|
||||
|
||||
Reference in New Issue
Block a user