Merge pull request #339 from lioncash/master

Fix some memory leaks in the core.
This commit is contained in:
Hans-Kristian Arntzen 2013-10-13 23:58:56 -07:00
commit 9da4203886
6 changed files with 10 additions and 2 deletions

View File

@ -54,6 +54,7 @@ static bool gl_init_font(void *data, const char *font_path, float font_size)
#endif
DbgFontInit(&cfg);
free(handle);
return true;
}

View File

@ -210,13 +210,17 @@ static char *align_program(const char *program)
size_t prog_size = strlen(program) + 1;
char *new_prog = (char*)calloc(1, prog_size);
if (!new_prog)
{
free(prog);
return NULL;
}
char *save;
char *line = dupe_newline(strtok_r(prog, "\n", &save));
if (!line)
{
free(prog);
free(new_prog);
return NULL;
}

View File

@ -84,8 +84,6 @@ static bool set_direct_pix_conv(struct scaler_ctx *ctx)
ctx->direct_pixconv = conv_argb8888_bgr24;
else if (ctx->in_fmt == SCALER_FMT_0RGB1555 && ctx->out_fmt == SCALER_FMT_BGR24)
ctx->direct_pixconv = conv_0rgb1555_bgr24;
else if (ctx->in_fmt == SCALER_FMT_RGB565 && ctx->out_fmt == SCALER_FMT_BGR24)
ctx->direct_pixconv = conv_rgb565_bgr24;
else if (ctx->in_fmt == SCALER_FMT_ARGB8888 && ctx->out_fmt == SCALER_FMT_ABGR8888)
ctx->direct_pixconv = conv_argb8888_abgr8888;
else

View File

@ -266,6 +266,7 @@ static CGprogramGroup rglCgCreateProgramGroupFromFile( CGcontext ctx, const char
if ( NULL == ptr )
{
rglCgRaiseError( CG_MEMORY_ALLOC_ERROR );
fclose(fp);
return ( CGprogramGroup )NULL;
}

View File

@ -254,6 +254,7 @@ int find_first_cue(const char* m3u_path, char* cue_path, size_t max_len) {
skip = 0;
} else if(midstream) {
cue_path[0] = '\0';
close(fd);
return 0;
}
break;
@ -270,6 +271,7 @@ int find_first_cue(const char* m3u_path, char* cue_path, size_t max_len) {
}
}
close(fd);
return -EINVAL;
}

View File

@ -126,6 +126,7 @@ static int get_sha1(const char *path, char *result)
}
if (!SHA1Result(&sha)) {
close(fd);
return -1;
}
@ -134,6 +135,7 @@ static int get_sha1(const char *path, char *result)
sha.Message_Digest[1],
sha.Message_Digest[2],
sha.Message_Digest[3], sha.Message_Digest[4]);
close(fd);
return 0;
}