]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsipc: don't free shm data if no shm id is found
authorRomain Naour <romain.naour@gmail.com>
Tue, 22 Mar 2016 21:19:54 +0000 (22:19 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 23 Mar 2016 09:52:41 +0000 (10:52 +0100)
commit90a9b9910cb7800f1bd4981b19f34d220393ff2c
tree1baa7ba791eaeb748e72ca3c377f1a111106bfba
parent7ce27dc517093a7b52408e2d6a9b6d1a063eb3b1
lsipc: don't free shm data if no shm id is found

There is a segfault in do_shm_global() when ipc_shm_get_info() return 0 and
ipc_shm_free_info() is called.

When no shm id is found, the memory allocated in shmds by ipc_shm_get_info() is
already free when ipc_shm_free_info() is called.

Move ipc_shm_free_info(shmds) inside the if statement where at least one shm id
is found.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
sys-utils/lsipc.c