Merge branch 'collectd-5.8'
[collectd.git] / src / nut.c
index 1d1e94b..997d1a5 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
@@ -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
   }