[PATCH 3/7] bootchooser: avoid a use after free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Juergen Borleis <jbe@xxxxxxxxxxxxxx>
---
 common/bootchooser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/bootchooser.c b/common/bootchooser.c
index 455f290fa..69d980d6f 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -376,9 +376,9 @@ struct bootchooser *bootchooser_get(void)
 			bc->state_prefix = xstrdup(state_prefix);
 			bc->state = state_by_name(state_devname);
 			if (!bc->state) {
-				free(state_devname);
 				pr_err("Cannot get state '%s'\n",
 				       state_devname);
+				free(state_devname);
 				ret = -ENODEV;
 				goto err;
 			}
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux