Permalink
Browse files

MFC r256833:

Drop cm_lock before calling mapper_close, which in turn could call
_citrus_mapper_close again and result in a deadlock otherwise.

This is similar to NetBSD PR/24023 (fixed in their r1.5 of this file).

PR:		bin/182994
Submitted by:	Fabian Keil <fk fabiankeil de>
Approved by:	re (hrs)
  • Loading branch information...
1 parent 817f332 commit be939ca962d3012cea3d32385af7527e0ce5c525 @delphij delphij committed Oct 24, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/libc/iconv/citrus_mapper.c
View
2 lib/libc/iconv/citrus_mapper.c
@@ -381,7 +381,9 @@ _citrus_mapper_close(struct _citrus_mapper *cm)
_CITRUS_HASH_REMOVE(cm, cm_entry);
free(cm->cm_key);
}
+ UNLOCK(&cm_lock);
mapper_close(cm);
+ return;
quit:
UNLOCK(&cm_lock);
}

0 comments on commit be939ca

Please sign in to comment.