mirror of https://github.com/x64dbg/zydis
fixed potential memory leak
This commit is contained in:
parent
f94792e4f9
commit
b93ddf848b
|
@ -526,6 +526,15 @@ VXBaseDataSourceContext* VXMemoryDataSource_Create(
|
||||||
|
|
||||||
if (!thiz || !ctx)
|
if (!thiz || !ctx)
|
||||||
{
|
{
|
||||||
|
if (thiz)
|
||||||
|
{
|
||||||
|
free(thiz);
|
||||||
|
}
|
||||||
|
if (ctx)
|
||||||
|
{
|
||||||
|
free(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -614,6 +623,20 @@ VXBaseDataSourceContext* VXCustomDataSource_Create(
|
||||||
VXCustomDataSource *thiz = malloc(sizeof(VXCustomDataSource));
|
VXCustomDataSource *thiz = malloc(sizeof(VXCustomDataSource));
|
||||||
VXBaseDataSourceContext *ctx = malloc(sizeof(VXBaseDataSourceContext));
|
VXBaseDataSourceContext *ctx = malloc(sizeof(VXBaseDataSourceContext));
|
||||||
|
|
||||||
|
if (!thiz || !ctx)
|
||||||
|
{
|
||||||
|
if (thiz)
|
||||||
|
{
|
||||||
|
free(thiz);
|
||||||
|
}
|
||||||
|
if (ctx)
|
||||||
|
{
|
||||||
|
free(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ctx->d.type = TYPE_CUSTOMDATASOURCE;
|
ctx->d.type = TYPE_CUSTOMDATASOURCE;
|
||||||
ctx->d.ptr = thiz;
|
ctx->d.ptr = thiz;
|
||||||
|
|
||||||
|
@ -656,6 +679,15 @@ VXInstructionDecoderContext* VXInstructionDecoder_CreateEx(VXBaseDataSourceConte
|
||||||
|
|
||||||
if (!thiz || !ctx)
|
if (!thiz || !ctx)
|
||||||
{
|
{
|
||||||
|
if (thiz)
|
||||||
|
{
|
||||||
|
free(thiz);
|
||||||
|
}
|
||||||
|
if (ctx)
|
||||||
|
{
|
||||||
|
free(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,6 +325,15 @@ VXBaseSymbolResolverContext* VXCustomSymbolResolver_Create(
|
||||||
|
|
||||||
if (!thiz || !ctx)
|
if (!thiz || !ctx)
|
||||||
{
|
{
|
||||||
|
if (thiz)
|
||||||
|
{
|
||||||
|
free(thiz);
|
||||||
|
}
|
||||||
|
if (ctx)
|
||||||
|
{
|
||||||
|
free(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -807,7 +816,18 @@ VXBaseInstructionFormatterContext* VXIntelInstructionFormatter_CreateEx(
|
||||||
VXBaseInstructionFormatterContext *ctx = malloc(sizeof(VXBaseInstructionFormatterContext));
|
VXBaseInstructionFormatterContext *ctx = malloc(sizeof(VXBaseInstructionFormatterContext));
|
||||||
|
|
||||||
if (!thiz || !ctx)
|
if (!thiz || !ctx)
|
||||||
|
{
|
||||||
|
if (thiz)
|
||||||
|
{
|
||||||
|
free(thiz);
|
||||||
|
}
|
||||||
|
if (ctx)
|
||||||
|
{
|
||||||
|
free(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
ctx->d.type = TYPE_INTELINSTRUCTIONFORMATTER;
|
ctx->d.type = TYPE_INTELINSTRUCTIONFORMATTER;
|
||||||
ctx->d.ptr = thiz;
|
ctx->d.ptr = thiz;
|
||||||
|
|
Loading…
Reference in New Issue