global: drop incorrect memset
shell_global_get_memory_info tries to zero initialize the output parameter with memset, but it passes the wrong size (because of a missing *). There's no reason to do the memset, though. In the normal case all members of the struct gets initialized before the function returns anyway. This commit drops the memset call in favor of one explicit 0 assignment that only gets executed on on atypical platforms. https://bugzilla.gnome.org/show_bug.cgi?id=662236
This commit is contained in:
parent
c573e7f9a1
commit
de352a309d
@ -1182,12 +1182,13 @@ shell_global_get_memory_info (ShellGlobal *global,
|
||||
JSContext *context;
|
||||
gint64 now;
|
||||
|
||||
memset (meminfo, 0, sizeof (meminfo));
|
||||
#ifdef HAVE_MALLINFO
|
||||
{
|
||||
struct mallinfo info = mallinfo ();
|
||||
meminfo->glibc_uordblks = info.uordblks;
|
||||
}
|
||||
#else
|
||||
meminfo->glibc_uordblks = 0;
|
||||
#endif
|
||||
|
||||
context = gjs_context_get_native_context (global->js_context);
|
||||
|
Loading…
Reference in New Issue
Block a user