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 657042 - libmenu: Don't try to unref potentially NULL pointers
libmenu: Don't try to unref potentially NULL pointers
Status: RESOLVED FIXED
Product: gnome-menus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2011-08-21 21:50 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-08-27 05:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libmenu: Don't try to unref potentially NULL pointers (1.55 KB, patch)
2011-08-21 21:50 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
libmenu: Don't try to unref potentially NULL pointers (1.07 KB, patch)
2011-08-22 12:07 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-08-21 21:50:09 UTC
Just a quick g_warning cleanup.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-08-21 21:50:10 UTC
Created attachment 194334 [details] [review]
libmenu: Don't try to unref potentially NULL pointers

When a DIRECTORY desktop entry fails to load, we'll try to unref
some NULL pointers. This was causing some warnings.
Comment 2 Christian Persch 2011-08-22 11:54:46 UTC
+      if (entry_directory->name != NULL)
+        {
+          g_free (entry_directory->name);

g_free already is NULL-safe.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-08-22 12:07:24 UTC
Created attachment 194354 [details] [review]
libmenu: Don't try to unref potentially NULL pointers

When a DIRECTORY desktop entry fails to load, we'll try to unref
some NULL pointers. This was causing some warnings.



... I knew that.
Comment 4 Matthias Clasen 2011-08-27 04:52:07 UTC
Review of attachment 194354 [details] [review]:

Looks correct to me.
Comment 5 Jasper St. Pierre (not reading bugmail) 2011-08-27 05:16:50 UTC
Attachment 194354 [details] pushed as 739d3f6 - libmenu: Don't try to unref potentially NULL pointers