Repositories
/
olsrd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2445d46
)
lq_plugin: do not confuse malloc size with name size
author
Ferry Huberts
<ferry.huberts@pelagic.nl>
Thu, 2 Jun 2016 19:01:48 +0000
(21:01 +0200)
committer
Ferry Huberts
<ferry.huberts@pelagic.nl>
Thu, 2 Jun 2016 20:06:48 +0000
(22:06 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/lq_plugin.c
patch
|
blob
|
history
diff --git
a/src/lq_plugin.c
b/src/lq_plugin.c
index
17d4c7f
..
a917c84
100644
(file)
--- a/
src/lq_plugin.c
+++ b/
src/lq_plugin.c
@@
-139,9
+139,9
@@
void
register_lq_handler(struct lq_handler *handler, const char *name)
{
struct lq_handler_node *node;
- size_t name_size = s
izeof(*node) + s
trlen(name) + 1;
+ size_t name_size = strlen(name) + 1;
- node = olsr_malloc(name_size, "olsr lq handler");
+ node = olsr_malloc(
sizeof(*node) +
name_size, "olsr lq handler");
strscpy(node->name, name, name_size);
node->node.key = node->name;