[Nut-upsdev] [nut-commits] svn commit r2839 - branches/windows_port/scripts/Windows
Arjen de Korte
nut+devel at de-korte.org
Tue Jan 18 10:32:15 UTC 2011
Citeren Frederic BOHE <fbohe-guest op alioth.debian.org>:
> --- branches/windows_port/scripts/Windows/wininit.c Tue Jan 18
> 08:57:03 2011 (r2838)
> +++ branches/windows_port/scripts/Windows/wininit.c Tue Jan 18
> 10:05:01 2011 (r2839)
> @@ -285,8 +285,11 @@
> char fn[SMALLBUF];
> FILE *nutf;
> char buf[SMALLBUF];
> + const char * conf_path;
>
> - snprintf(fn,sizeof(fn),"%s/nut.conf",CONFPATH);
> + conf_path = confpath();
> + snprintf(fn,sizeof(fn),"%s/nut.conf",conf_path);
> + free(conf_path);
This won't work. You can't free() conf_path here, since it is not
dynamically allocated. Use
snprintf(fn, sizeof(fn), "%s/nut.conf", confpath());
instead.
Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)
More information about the Nut-upsdev
mailing list