Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
device-mapper.14215
bug-1164718_28-lvmcache-free-resource-on-error-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bug-1164718_28-lvmcache-free-resource-on-error-path.patch of Package device-mapper.14215
From 34bde8b6c7e517239a05334683a09f2b5075fdcc Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac <zkabelac@redhat.com> Date: Fri, 8 Nov 2019 12:51:48 +0100 Subject: [PATCH] lvmcache: free resource on error path Free allocated svg on error path. Also explicitely ignore dm_strncpy() result. (We know it will end with failure here.) --- lib/cache/lvmcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 9890325..c12ec2b 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -325,10 +325,12 @@ void lvmcache_save_vg(struct volume_group *vg, int precommitted) dm_list_init(&svg->saved_vg_to_free); - dm_strncpy(svg->vgid, (const char *)vg->id.uuid, sizeof(svg->vgid)); + /* Ignore result code, size we intentionally short-cut & pad with 0 */ + (void) dm_strncpy(svg->vgid, (const char *)vg->id.uuid, sizeof(svg->vgid)); if (!dm_hash_insert(_saved_vg_hash, svg->vgid, svg)) { log_error("lvmcache: failed to insert saved_vg %s", svg->vgid); + dm_free(svg); return; } } else { -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor