cgrou-props: typo fix

Submitted by Andrei Vagin on May 17, 2016, 6:07 a.m.

Details

Message ID 1463465259-882-1-git-send-email-avagin@openvz.org
State Accepted
Series "cgrou-props: typo fix"
Commit e30976fd799d7e02acfdd470dc49b0e11c9eff47
Headers show

Commit Message

Andrei Vagin May 17, 2016, 6:07 a.m.
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@openvz.org>
---
 criu/cgroup-props.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;
 		}
 

Comments

Cyrill Gorcunov May 17, 2016, 6:12 a.m.
On Tue, May 17, 2016 at 09:07:39AM +0300, Andrey Vagin wrote:
> 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@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>

Thank you!
Pavel Emelianov May 20, 2016, 11:24 a.m.
Applied