Author: ek.kato
Date: Mon Jan 5 20:37:40 2009
New Revision: 5697
Modified:
trunk/uim/bsdlook.c
Log:
* uim/bsdlook.c (uim_look_finish) : Add check.
Modified: trunk/uim/bsdlook.c
==============================================================================
--- trunk/uim/bsdlook.c (original)
+++ trunk/uim/bsdlook.c Mon Jan 5 20:37:40 2009
@@ -166,10 +166,12 @@
if (!ctx)
return;
- if (ctx->front0 != MAP_FAILED && munmap(ctx->front0, ctx->len) == -1)
+ if (ctx->front0 > 0 && munmap(ctx->front0, ctx->len) == -1)
perror("uim_look_finish");
- close(ctx->fd);
+ if (ctx->fd > 0)
+ close(ctx->fd);
+
free(ctx);
return;
}