Mercurial > repos > blastem
comparison nuklear_ui/font.c @ 1593:24508cb54f87
Fix a number of other memory errors (mostly leaks again) identified by valgrind
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 28 Jun 2018 09:27:05 -0700 |
parents | 4f6e8acd7b6a |
children | 253c62b7144e |
comparison
equal
deleted
inserted
replaced
1592:31effaadf877 | 1593:24508cb54f87 |
---|---|
33 char *path = default_font_path(); | 33 char *path = default_font_path(); |
34 if (!path) { | 34 if (!path) { |
35 goto error; | 35 goto error; |
36 } | 36 } |
37 FILE *f = fopen(path, "rb"); | 37 FILE *f = fopen(path, "rb"); |
38 free(path); | |
38 if (!f) { | 39 if (!f) { |
39 goto error; | 40 goto error; |
40 } | 41 } |
41 long size = file_size(f); | 42 long size = file_size(f); |
42 uint8_t *buffer = malloc(size); | 43 uint8_t *buffer = malloc(size); |