mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-06-16 02:15:48 +00:00
Don't touch rss if it hasn't been initialized in get_memusage
Followup for Coverity CID 1308302
This commit is contained in:
+2
-1
@@ -748,10 +748,11 @@ void get_memusage(uint64_t * rss, uint64_t * vsz) {
|
||||
i = fscanf(procfile, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %llu %lld", (unsigned long long *) vsz, (unsigned long long *) rss);
|
||||
if (i != 2) {
|
||||
uwsgi_log("warning: invalid record in /proc/self/stat\n");
|
||||
} else {
|
||||
*rss = *rss * uwsgi.page_size;
|
||||
}
|
||||
fclose(procfile);
|
||||
}
|
||||
*rss = *rss * uwsgi.page_size;
|
||||
#elif defined(__CYGWIN__)
|
||||
// same as Linux but rss is not in pages...
|
||||
FILE *procfile;
|
||||
|
||||
Reference in New Issue
Block a user