X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsysctl%2Fsysctl.c;h=283eefe1a1d233e49786034668d64c80cbe507f6;hb=4c63a53ac5190dc8b837c15daefec5772de66bdc;hp=76efacb14a0227029b3a7d2a88dd36dd4ea9509a;hpb=cc3d61683d877791e6b2ce0b17940d4d77cd6550;p=elogind.git diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 76efacb14..283eefe1a 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -65,7 +65,7 @@ static int apply_sysctl(const char *property, const char *value) { log_debug("Setting '%s' to '%s'", property, value); - p = new(char, sizeof("/proc/sys/") + strlen(property)); + p = new(char, strlen("/proc/sys/") + strlen(property) + 1); if (!p) return log_oom(); @@ -123,7 +123,7 @@ static int parse_file(Hashmap *sysctl_options, const char *path, bool ignore_eno assert(path); - r = search_and_fopen_nulstr(path, "re", conf_file_dirs, &f); + r = search_and_fopen_nulstr(path, "re", NULL, conf_file_dirs, &f); if (r < 0) { if (ignore_enoent && r == -ENOENT) return 0;