After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662236 - global: drop incorrect memset
global: drop incorrect memset
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-19 20:25 UTC by Ray Strode [halfline]
Modified: 2011-10-19 21:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
global: drop incorrect memset (1.25 KB, patch)
2011-10-19 20:25 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2011-10-19 20:25:46 UTC
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.
Comment 1 Ray Strode [halfline] 2011-10-19 20:25:48 UTC
Created attachment 199477 [details] [review]
global: drop incorrect memset
Comment 2 Colin Walters 2011-10-19 21:04:46 UTC
Review of attachment 199477 [details] [review]:

Yes.
Comment 3 Ray Strode [halfline] 2011-10-19 21:13:53 UTC
Attachment 199477 [details] pushed as de352a3 - global: drop incorrect memset