qrexec-lib: fix memory leak
If xs_read returns pointer to empty string (len==0), then it was leaked.
This commit is contained in:
parent
c3ef1acb1a
commit
2739340559
@ -199,9 +199,10 @@ char *peer_client_init(int dom, int port)
|
|||||||
free(vec);
|
free(vec);
|
||||||
len = 0;
|
len = 0;
|
||||||
dummy = xs_read(xs, 0, devbuf, &len);
|
dummy = xs_read(xs, 0, devbuf, &len);
|
||||||
|
if (dummy)
|
||||||
|
free(dummy);
|
||||||
}
|
}
|
||||||
while (!dummy || !len); // wait for the server to create xenstore entries
|
while (!dummy || !len); // wait for the server to create xenstore entries
|
||||||
free(dummy);
|
|
||||||
xs_daemon_close(xs);
|
xs_daemon_close(xs);
|
||||||
|
|
||||||
// now client init should succeed; "while" is redundant
|
// now client init should succeed; "while" is redundant
|
||||||
|
Loading…
Reference in New Issue
Block a user