]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix user-after-free bug in error path in --monitor mode.
authorNeil Brown <neilb@suse.de>
Mon, 26 Jun 2006 05:10:55 +0000 (15:10 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 26 Jun 2006 05:10:55 +0000 (15:10 +1000)
Monitor.c

index 5797870ce2e5e7f1dd7c9c97d7c53174d2e627b7..7a8c0713082deed4552691d31184e903fad59a67 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -383,9 +383,9 @@ int Monitor(mddev_dev_t devlist,
                                            ioctl(fd, GET_ARRAY_INFO, &array)< 0) {
                                                /* no such array */
                                                if (fd >=0) close(fd);
+                                               put_md_name(st->devname);
                                                free(st->devname);
                                                free(st);
-                                               put_md_name(st->devname);
                                                continue;
                                        }
                                        close(fd);