X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnut.c;h=ae48692b8b15204f1e3f73e73ad41aee8be4fc4a;hb=c4439c9cb3e2348ad7013644731de27a55eca478;hp=1d1e94b521cc9fdd02a19e58e828ba2c182d3795;hpb=a0412f28fc15eb04a9a630678a97b6bce2d71fb1;p=collectd.git diff --git a/src/nut.c b/src/nut.c index 1d1e94b5..ae48692b 100644 --- a/src/nut.c +++ b/src/nut.c @@ -27,8 +27,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include @@ -144,8 +144,7 @@ static int nut_verify_peer(const char *value) { static int nut_ca_path(const char *value) { if (value != NULL && strcmp(value, "") != 0) { - ca_path = malloc(strlen(value) + 1); - strncpy(ca_path, value, (strlen(value) + 1)); + ca_path = strdup(value); } else { ca_path = NULL; // Should alread be set to NULL from initialization }