[libgrss] src: Remove some unnecessary NULL checks



commit 7021e8ceff5f119924c2a813ddc2b5b71f2bfd10
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Dec 21 16:50:41 2016 +0000

    src: Remove some unnecessary NULL checks
    
    These were redundant, given that feed was dereferenced on every path up
    to them. Add a precondition check for NULL instead.
    
    Coverity ID: 1388550
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776115

 src/feed-atom-handler.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/feed-atom-handler.c b/src/feed-atom-handler.c
index f8cf47c..998baab 100644
--- a/src/feed-atom-handler.c
+++ b/src/feed-atom-handler.c
@@ -329,6 +329,8 @@ atom10_parse_link (xmlNodePtr cur, GrssFeedChannel *feed, GrssFeedItem *item)
        const gchar *home;
        gchar *alternate = NULL;
 
+       g_return_val_if_fail (GRSS_IS_FEED_CHANNEL (feed), NULL);
+
        href = (gchar*) xmlGetNsProp (cur, BAD_CAST"href", NULL);
 
        if (href) {
@@ -384,12 +386,10 @@ atom10_parse_link (xmlNodePtr cur, GrssFeedChannel *feed, GrssFeedItem *item)
                        */
                }
                else if (g_str_equal (relation, "hub")) {
-                       if (feed != NULL)
-                               grss_feed_channel_set_pubsubhub (feed, url);
+                       grss_feed_channel_set_pubsubhub (feed, url);
                }
                else if (g_str_equal (relation, "self")) {
-                       if (feed != NULL)
-                               grss_feed_channel_set_source (feed, url);
+                       grss_feed_channel_set_source (feed, url);
                }
 
                xmlFree (title);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]