Author: ek.kato
Date: Mon Jan 5 20:12:26 2009
New Revision: 5696
Modified:
trunk/uim/bsdlook.c
Log:
* uim/bsdlook.c (uim_look_finish) : Plug leak.
Modified: trunk/uim/bsdlook.c
==============================================================================
--- trunk/uim/bsdlook.c (original)
+++ trunk/uim/bsdlook.c Mon Jan 5 20:12:26 2009
@@ -163,14 +163,14 @@
void
uim_look_finish(uim_look_ctx *ctx)
{
- if (!ctx || ctx->front0 == 0)
+ if (!ctx)
return;
- if (munmap(ctx->front0, ctx->len) == -1) {
+ if (ctx->front0 != MAP_FAILED && munmap(ctx->front0, ctx->len) == -1)
perror("uim_look_finish");
- return;
- }
+
close(ctx->fd);
+ free(ctx);
return;
}