mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib: fix drive struct leak on hotplug error in guestfs_impl_add_drive_opts (#318)
When guestfs_impl_add_drive_opts is called outside CONFIG state, the hotplug error path returns -1 without freeing the already-allocated drv structure. Co-authored-by: Claude Local LLM <noreply@anthropic.com>
This commit is contained in:
@@ -820,6 +820,7 @@ guestfs_impl_add_drive_opts (guestfs_h *g,
|
||||
|
||||
/* ... else the old hotplugging case */
|
||||
error (g, _("hotplugging support was removed in libguestfs 1.48"));
|
||||
free_drive_struct (drv);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user