Skip the session destruction test if the target session is not
found. Otherwise, a NULL pointer dereference will occur.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
ok(tmp != NULL,
"Destroying session: session found");
- ok(destroy_one_session(tmp) == 0,
- "Destroying session: %s destroyed",
- SESSION1);
+ if (tmp) {
+ ok(destroy_one_session(tmp) == 0,
+ "Destroying session: %s destroyed",
+ SESSION1);
+ } else {
+ skip(1, "Skipping session destruction as it was not found");
+ }
session_unlock_list();
}