You only need to free the mutex if you have obtained ownership. Please note that there are 4 possible return values, in 2 cases you get ownership, and in 2 you do not.
WAIT_ABANDONED - you obtained ownership and must release the mutex, but the previous owner stopped working without explicitly releasing the mutext, so the shared state may be inconsistent.
WAIT_OBJECT_0 - You have ownership. You need to free the mutext.
WAIT_TIMEOUT - Mutext was not released at timeout.
WAIT_FAILED - usually due to an error in your code (i.e. invalid handle).
source share