summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-04-10 12:55:26 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2013-04-10 12:55:26 (GMT)
commitc9b04ac6aef4807365e2c632849a419c8df9961f (patch)
tree1b91c0c76774c27164be08824e4dbb45bdea52ce
parent08f5d6e00ff12502cea62e7410da3df0cc18ab3b (diff)
downloadlibnsfb-c9b04ac6aef4807365e2c632849a419c8df9961f.tar.gz
libnsfb-c9b04ac6aef4807365e2c632849a419c8df9961f.tar.bz2
Fix leak.
-rw-r--r--src/surface/linux.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/surface/linux.c b/src/surface/linux.c
index d524002..b5bf8ad 100644
--- a/src/surface/linux.c
+++ b/src/surface/linux.c
@@ -106,11 +106,15 @@ static int linux_initialise(nsfb_t *nsfb)
return -1;
lstate = calloc(1, sizeof(struct lnx_priv));
+ if (lstate == NULL) {
+ return -1;
+ }
/* Open the framebuffer device in read write */
lstate->fd = open(FB_NAME, O_RDWR);
if (lstate->fd < 0) {
printf("Unable to open %s.\n", FB_NAME);
+ free(lstate);
return -1;
}