projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc3637c
)
sigrok plugin: malloc + memset -> calloc
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:16:28 +0000
(18:16 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 1 Apr 2016 16:16:28 +0000
(18:16 +0200)
src/sigrok.c
patch
|
blob
|
history
diff --git
a/src/sigrok.c
b/src/sigrok.c
index
4e61f94
..
6c781f8
100644
(file)
--- a/
src/sigrok.c
+++ b/
src/sigrok.c
@@
-72,11
+72,10
@@
static int sigrok_config_device(oconfig_item_t *ci)
struct config_device *cfdev;
int i;
- if (!(cfdev =
malloc(
sizeof(*cfdev)))) {
- ERROR("sigrok plugin:
malloc()
failed.");
+ if (!(cfdev =
calloc(1,
sizeof(*cfdev)))) {
+ ERROR("sigrok plugin:
calloc
failed.");
return -1;
}
- memset(cfdev, 0, sizeof(*cfdev));
if (cf_util_get_string(ci, &cfdev->name)) {
free(cfdev);
WARNING("sigrok plugin: Invalid device name.");