eriknyquist/librxvm

Remove unnecessary null pointer checks

elfring opened this issue · 5 comments

Thanks for that, good point

Thanks for your small source code improvement.

Were any update candidates left over for such a change pattern?

No, the check in rxvm_free serves another purpose besides protecting the free(). If compiled->simple is non-NULL, then I know that compiled->exe was never allocated so I don't need to traverse/free it. It needs to stay.

How do you think about to integrate the following small change?

         for (i = 0; i < compiled->size; i++) {
-            if (compiled->exe[i].ccs != NULL)
-                free(compiled->exe[i].ccs);
+            free(compiled->exe[i].ccs);
         }