Files
podman/libpod
Matthew Heon 92cdad0315 Fix a potential defer logic error around locking
in several top-level API functions. These are the first line of
the function that contains them, which makes sense; we want to
capture any error returned by the function. However, making this
the first defer means that it is the last thing to run after the
function returns - meaning that the container's
`defer c.lock.Unlock()` has already fired, leading to a chance we
modify the container without holding its lock.

We could move the function around so it's no longer the first
defer, but then we'd have to call it twice (immediately after
`defer c.lock.Unlock()` if the container is not batched, and a
second time in a new `else` block right after the lock/sync call
to make sure we handle batched containers). Seems simpler to just
leave it like this.

[NO NEW TESTS NEEDED] Can't really test for DB corruption easily.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2023-01-06 13:12:19 -05:00
..
2022-01-18 12:47:07 +01:00
2017-11-01 11:24:59 -04:00
2022-12-15 13:39:56 +01:00
2022-10-17 09:19:41 +02:00
2022-01-18 12:47:07 +01:00
2022-09-10 07:52:00 -04:00
2022-09-20 15:34:27 -04:00
2022-09-10 07:52:00 -04:00
2022-09-10 07:52:00 -04:00
2022-09-10 07:52:00 -04:00
2022-04-25 13:23:20 +02:00
2022-09-01 13:02:01 -04:00
2022-10-17 09:19:41 +02:00
2022-12-15 13:39:56 +01:00
2022-01-18 12:47:07 +01:00
2022-07-21 14:50:01 -04:00
2022-09-20 15:34:27 -04:00
2022-09-10 07:52:00 -04:00
2022-09-20 15:34:27 -04:00
2022-09-10 07:52:00 -04:00
2022-01-18 12:47:07 +01:00