1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-12 19:06:36 +00:00

fixed another memleak issue in smapi.c

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1032 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Phil 2008-03-22 19:39:43 +00:00
parent 8fd27c0026
commit 929f1d5878

View File

@ -90,11 +90,11 @@ int smapi_get_bat_int(int idx, char *fname)
char *smapi_get_bat_val(char *args)
{
char *fname;
char fname[128];
int idx, cnt;
if(sscanf(args, "%i %n", &idx, &cnt) <= 0 ||
!(fname = strdup(args + cnt))) {
snprintf(fname, 127, "%s", (args + cnt)) < 0) {
ERR("smapi: wrong arguments, should be 'bat,<int>,<str>'");
return NULL;
}