]> Pileus Git - ~andy/fetchmail/blobdiff - smbutil.c
Make some explicit NULL checks to pacify llvm-clang's static analyzer
[~andy/fetchmail] / smbutil.c
index 18aa1dc4c7c3ec9b7857dff21b96022b1ea6d9f5..fd239d9ca163083c92a9bfbe5c01de44252236d1 100644 (file)
--- a/smbutil.c
+++ b/smbutil.c
@@ -85,7 +85,7 @@ static void dumpRaw(FILE *fp, unsigned char *buf, size_t len)
 /* helper macro to destructively resize buffers; assumes that bufsiz
  * is initialized to 0 if buf is unallocated! */
 #define allocbuf(buf, bufsiz, need) do { \
-  if ((need) > (bufsiz)) \
+  if (!buf || (need) > (bufsiz)) \
     { \
     (bufsiz) = ((need) < 1024) ? 1024 : (need); \
     xfree(buf); \