From dd535ac6f8bcceff75804dfd4eaca6df894e6c70 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 10 Mar 2015 23:46:10 +0000 Subject: [PATCH] ksysguard: remove the memory leaking scan_one() --- ksysguard/ksysguardd/Linux/Memory.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ksysguard/ksysguardd/Linux/Memory.c b/ksysguard/ksysguardd/Linux/Memory.c index 6b2fcabe..21f6b777 100644 --- a/ksysguard/ksysguardd/Linux/Memory.c +++ b/ksysguard/ksysguardd/Linux/Memory.c @@ -46,22 +46,8 @@ static unsigned long long STotal = 0; static unsigned long long SFree = 0; static unsigned long long SUsed = 0; -static void scan_one( const char* buff, const char *key, unsigned long long* val ) -{ - int o; - char *b = strstr( buff, key ); - if ( b ) - o = sscanf( b + strlen( key ), ": %llu", val ); -} - static void processMemInfo() { - scan_one( MemInfoBuf, "MemTotal", &Total ); - scan_one( MemInfoBuf, "MemFree", &MFree ); - scan_one( MemInfoBuf, "Buffers", &Buffers ); - scan_one( MemInfoBuf, "Cached", &Cached ); - scan_one( MemInfoBuf, "SwapTotal", &STotal ); - scan_one( MemInfoBuf, "SwapFree", &SFree ); Used = Total - MFree; Appl = ( Used - ( Buffers + Cached ) ); -- 2.11.0