All the error paths but one will free buf. Cover the remaining path so
buf can't be leaked.
This bug was discovered and resolved using Coverity Static Analysis
Security Testing (SAST) by Synopsys, Inc.
Fixes: 7f97193e6aa8 ("tools/xenstore: add live update command to xenstore-control")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
return 1;
ret = strdup("BUSY");
- if (!ret)
+ if (!ret) {
+ free(buf);
return 1;
+ }
for (time_start = time(NULL); time(NULL) - time_start < to;) {
free(ret);