diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-08-10 18:14:57 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2017-08-10 18:14:57 +0000 |
commit | 6c57c8afe3cbcaf5b831c447f6bb299d43e81fdd (patch) | |
tree | 8b5da2eb5720d1da88d3b5d3a822495a241eb363 /sys/dev/pv | |
parent | fc91da7fc6dd5f82fc0edee6023a33639f567b15 (diff) |
Prevent an unlikely resource leak
Coverity CID 1453069; Severity: unlikely, not user-visible.
Diffstat (limited to 'sys/dev/pv')
-rw-r--r-- | sys/dev/pv/xenstore.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pv/xenstore.c b/sys/dev/pv/xenstore.c index ad02068ecc2..eb77d384b26 100644 --- a/sys/dev/pv/xenstore.c +++ b/sys/dev/pv/xenstore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xenstore.c,v 1.43 2017/03/13 01:10:03 mikeb Exp $ */ +/* $OpenBSD: xenstore.c,v 1.44 2017/08/10 18:14:56 mikeb Exp $ */ /* * Copyright (c) 2015 Mike Belopuhov @@ -845,8 +845,10 @@ xs_watch(void *xsc, const char *path, const char *property, struct task *task, ret = snprintf(key, sizeof(key), "%s/%s", path, property); else ret = snprintf(key, sizeof(key), "%s", property); - if (ret == -1 || ret >= sizeof(key)) + if (ret == -1 || ret >= sizeof(key)) { + free(xsw, M_DEVBUF, sizeof(*xsw)); return (EINVAL); + } iov.iov_base = xsw->xsw_token; iov.iov_len = sizeof(xsw->xsw_token); |