From 2c570ad128bc3b0413b5ddae79acc1e6de3949e0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 11 Jan 2016 09:21:58 -0800 Subject: [PATCH] ofp-parse: Use xstrdup() instead of strdup(). This avoids a null pointer dereference in the case of memory allocation failure. Found by inspection. Signed-off-by: Ben Pfaff Acked-by: Russell Bryant --- lib/ofp-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 822a298c4..4bd8521f2 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -899,7 +899,7 @@ parse_ofp_table_vacancy(struct ofputil_table_mod *tm, const char *setting) { char *save_ptr = NULL; char *vac_up, *vac_down; - char *value = strdup(setting); + char *value = xstrdup(setting); char *ret_msg; int vacancy_up, vacancy_down; -- 2.20.1