projects
/
cascardo
/
ovs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e79d1ed
)
ofp-parse: Use xstrdup() instead of strdup().
author
Ben Pfaff
<blp@ovn.org>
Mon, 11 Jan 2016 17:21:58 +0000
(09:21 -0800)
committer
Ben Pfaff
<blp@ovn.org>
Mon, 11 Jan 2016 23:01:36 +0000
(15:01 -0800)
This avoids a null pointer dereference in the case of memory allocation
failure.
Found by inspection.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
lib/ofp-parse.c
patch
|
blob
|
history
diff --git
a/lib/ofp-parse.c
b/lib/ofp-parse.c
index
822a298
..
4bd8521
100644
(file)
--- 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 =
x
strdup(setting);
char *ret_msg;
int vacancy_up, vacancy_down;