From: "Richard W.M. Jones" <rjones(a)redhat.com>
Don't leak old drv->device when add_drives is called multiple times.
---
fish/options.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/fish/options.c b/fish/options.c
index 48c8e1c..f652389 100644
--- a/fish/options.c
+++ b/fish/options.c
@@ -43,6 +43,9 @@ add_drives (struct drv *drv, char next_drive)
if (drv) {
next_drive = add_drives (drv->next, next_drive);
+ free (drv->device);
+ drv->device = NULL;
+
if (asprintf (&drv->device, "/dev/sd%c", next_drive) == -1) {
perror ("asprintf");
exit (EXIT_FAILURE);
--
1.7.6