summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc3637c)
raw | patch | inline | side by side (parent: dc3637c)
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 4e61f946f0230874074a222986e494b16fc1dd9d..6c781f81c50a56597be7cfa376a776158dcd687a 100644 (file)
--- a/src/sigrok.c
+++ b/src/sigrok.c
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.");