]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hibernate-util: add missing assertion
authorMike Yuan <me@yhndnzj.com>
Sat, 21 Oct 2023 11:53:04 +0000 (19:53 +0800)
committerMike Yuan <me@yhndnzj.com>
Mon, 23 Oct 2023 15:12:27 +0000 (23:12 +0800)
src/shared/hibernate-util.c

index 4a05320a40e6cd6491319dfff91ac77c072cc54e..51f64aa2b190795375a23c06d4ab00f72bc8e0a2 100644 (file)
@@ -408,6 +408,8 @@ static int get_proc_meminfo_active(unsigned long long *ret) {
         unsigned long long active;
         int r;
 
+        assert(ret);
+
         r = get_proc_field("/proc/meminfo", "Active(anon)", WHITESPACE, &active_str);
         if (r < 0)
                 return log_debug_errno(r, "Failed to retrieve Active(anon) from /proc/meminfo: %m");