diff options
| author | Robert Wing <rew@FreeBSD.org> | 2021-03-11 19:27:43 +0000 |
|---|---|---|
| committer | Robert Wing <rew@FreeBSD.org> | 2021-05-11 23:11:52 +0000 |
| commit | a7f81b488df2d4a5dcd785b4112e04ffb6ca0442 (patch) | |
| tree | c940f505a21c3d08e560d3b4b7b109a1da2448be /lib/libvmmapi | |
| parent | b2ae176d914acd63247e24d7e23dbe8f239fbfb0 (diff) | |
Diffstat (limited to 'lib/libvmmapi')
| -rw-r--r-- | lib/libvmmapi/vmmapi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 7faa2fc545ea..5810274c9a73 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -118,6 +118,7 @@ struct vmctx * vm_open(const char *name) { struct vmctx *vm; + int saved_errno; vm = malloc(sizeof(struct vmctx) + strlen(name) + 1); assert(vm != NULL); @@ -133,7 +134,9 @@ vm_open(const char *name) return (vm); err: + saved_errno = errno; free(vm); + errno = saved_errno; return (NULL); } |
