Allow using gpgrt_lock_init on an unitialized variable.
* src/posix-lock.c (gpgrt_lock_init): Detect unitialized lock var. * src/w32-lock.c (gpgrt_lock_init): Ditto.
gpgrt_lock_init may be used for dynamically allocated locks. For
example
gpgrt_lock_t *lock = xcalloc (1, sizeof *lock); gpgrt_lock_init (lock); gpgrt_lock_lock (lock); foo (); gpgrt_lock_unlock (lock); gpgrt_lock_destroy (lock); free (lock);
This patch actually allows for this.
- Signed-off-by: Werner Koch <wk@gnupg.org>