coverity 181579: check result of malloc as intended
authorAndy Green <andy@warmcat.com>
Wed, 19 Jul 2017 06:17:39 +0000 (14:17 +0800)
committerAndy Green <andy@warmcat.com>
Wed, 19 Jul 2017 06:17:39 +0000 (14:17 +0800)
lib/ssl.c

index 46b4f7f..c517267 100644 (file)
--- a/lib/ssl.c
+++ b/lib/ssl.c
@@ -41,7 +41,7 @@ int lws_alloc_vfs_file(struct lws_context *context, const char *filename, uint8_
        len = lws_vfs_get_length(fops_fd);
 
        *buf = malloc((size_t)len);
-       if (!buf)
+       if (!*buf)
                goto bail;
 
        if (lws_vfs_file_read(fops_fd, amount, *buf, len))