Page MenuHomeFreeBSD

Fix memory leak in vmstat
AcceptedPublic

Authored by trix_juniper.net on Mar 14 2017, 3:43 PM.
Tags
Referenced Files
Unknown Object (File)
Sat, Sep 5, 2:16 AM
Unknown Object (File)
Thu, Sep 3, 2:39 AM
Unknown Object (File)
Tue, Sep 1, 2:54 AM
Unknown Object (File)
Sun, Aug 30, 2:27 AM
Unknown Object (File)
Sat, Aug 29, 11:39 PM
Unknown Object (File)
Wed, Aug 26, 4:15 PM
Unknown Object (File)
Aug 3 2026, 8:37 PM
Unknown Object (File)
Aug 2 2026, 5:15 AM
Subscribers

Details

Reviewers
alc
will
Summary

vmstat.c dointr
Free memory assigned to intrnames before returning.
Free memory assigned to intrcnts before breaking out of while loop. Move assignment of old_intrcnts to after the break check because it isn't needed before the check.

Test Plan

Use clang's static analyzer, scan-build, to find the problem and later to show resolution.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped