]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Undefined: avoid null warning in tmp_unlink
authorAnders Björklund <anders@psqr.se>
Sun, 13 Nov 2016 15:50:50 +0000 (16:50 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 12 Feb 2017 13:57:13 +0000 (14:57 +0100)
util.c:1468:6: runtime error: null pointer passed as argument 1, which is declared to never be null

ccache.c

index c6b7b5d14a41bb5ce75e01e2bcfecb68d9d8c417..2c14795a0cf220c706bbef2e699d77546e3ad348 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1126,7 +1126,9 @@ to_cache(struct args *args)
                if (tmp_cov) {
                        tmp_unlink(tmp_cov);
                }
-               tmp_unlink(tmp_dwo);
+               if (tmp_dwo) {
+                       tmp_unlink(tmp_dwo);
+               }
                failed();
        }
        if (st.st_size != 0) {
@@ -1137,7 +1139,9 @@ to_cache(struct args *args)
                if (tmp_cov) {
                        tmp_unlink(tmp_cov);
                }
-               tmp_unlink(tmp_dwo);
+               if (tmp_dwo) {
+                       tmp_unlink(tmp_dwo);
+               }
                failed();
        }
        tmp_unlink(tmp_stdout);
@@ -1198,7 +1202,9 @@ to_cache(struct args *args)
                if (tmp_cov) {
                        tmp_unlink(tmp_cov);
                }
-               tmp_unlink(tmp_dwo);
+               if (tmp_dwo) {
+                       tmp_unlink(tmp_dwo);
+               }
 
                failed();
        }