We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc4d2a1 commit b664e3fCopy full SHA for b664e3f
src/nanovg.c
@@ -288,7 +288,11 @@ NVGcontext* nvgCreateInternal(NVGparams* params)
288
FONSparams fontParams;
289
NVGcontext* ctx = (NVGcontext*)malloc(sizeof(NVGcontext));
290
int i;
291
- if (ctx == NULL) goto error;
+ if (ctx == NULL) {
292
+ if (ctx->params.userPtr)
293
+ free(ctx->params.userPtr);
294
+ goto error;
295
+ }
296
memset(ctx, 0, sizeof(NVGcontext));
297
298
ctx->params = *params;
src/nanovg_gl.h
@@ -1589,7 +1589,7 @@ NVGcontext* nvgCreateGLES3(int flags)
1589
return ctx;
1590
1591
error:
1592
- if (gl != NULL) free(gl);
+ // 'gl' is freed by nvgDeleteInternal.
1593
return NULL;
1594
}
1595
0 commit comments