[CRIU] [PATCH] cgrou-props: typo fix

Andrey Vagin avagin at openvz.org
Mon May 16 23:07:39 PDT 2016


280                             xfree(p);
>>>     CID 161428:  Memory - illegal accesses  (USE_AFTER_FREE)
>>>     Passing freed pointer "p" as an argument to "print_on_level".
281                             pr_err("Unknown strategy \"%s\" in controller's %s stream\n",
282                                    p, cgp_entry->cgp.name);

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 criu/cgroup-props.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/cgroup-props.c b/criu/cgroup-props.c
index 5328efc..a5b1a00 100644
--- a/criu/cgroup-props.c
+++ b/criu/cgroup-props.c
@@ -277,9 +277,9 @@ static int cgp_parse_stream(char *stream, size_t len)
 		} else if (!strcmp(p, "replace")) {
 			strategy = CGP_REPLACE;
 		} else {
-			xfree(p);
 			pr_err("Unknown strategy \"%s\" in controller's %s stream\n",
 			       p, cgp_entry->cgp.name);
+			xfree(p);
 			goto err_parse;
 		}
 
-- 
2.5.5



More information about the CRIU mailing list