Commit 9b62e40e by Carlos Martín Nieto

clar helper: don't dereference giterr_last() if it's NULL

It can cause segfaults if the call didn't set an error
parent 49ac5ac8
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#define cl_git_pass(expr) do { \ #define cl_git_pass(expr) do { \
giterr_clear(); \ giterr_clear(); \
if ((expr) != 0) \ if ((expr) != 0) \
clar__assert(0, __FILE__, __LINE__, "Function call failed: " #expr, giterr_last()->message, 1); \ clar__assert(0, __FILE__, __LINE__, "Function call failed: " #expr, giterr_last() ? giterr_last()->message : NULL, 1); \
} while(0) } while(0)
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment