Fix Coverity warning.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 27 Jul 2020 10:01:56 +0000 (19:01 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 27 Jul 2020 10:01:56 +0000 (19:01 +0900)
CID 1430580:  Null pointer dereferences  (REVERSE_INULL).
Patch provided by Hou, Zhijie.

src/utils/pool_select_walker.c

index 40b09099d6af46b4a7c6dfc9a38d4770f8fda74b..c53cc4f8cc9c2b8f73acb4c65f170bb60ea0f6ee 100644 (file)
@@ -1047,10 +1047,8 @@ is_immutable_function(char *fname)
        if(!SplitIdentifierString(rawstring, '.', (Node **) &names) ||
                names == NIL)
        {
-               if(rawstring)
-                       pfree(rawstring);
-               if(names)
-                       list_free(names);
+               pfree(rawstring);
+               list_free(names);
 
                ereport(WARNING,
                                (errmsg("invalid function name %s", fname)));