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:
parent
8fd27c0026
commit
929f1d5878
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user