blktap2: initialise buf to NULL in img2qcow.c:main

Gcc complains:

qcow2raw.c: In function ‘main’:
qcow2raw.c:387:17: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    treq.buf     = buf;
                 ^

But at the point of that assignment, buf is a valid buffer allocated by
posix_memalign and filled in by read.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Wei Liu committed 2016-05-06 15:50:28 +01:00
1 parent 01120b223a
commit 7e2a1f9402
1 file changed
+1 -1
+1 -1
View File
@@ -166,7 +166,7 @@ int main(int argc, const char *argv[])
int ret = -1, fd, len, err;
struct timeval timeout;
uint64_t i;
char *buf;
char *buf = NULL;
td_request_t treq;
td_disk_info_t info;
td_vbd_request_t* vreq;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.