mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-07 15:32:13 +00:00
Fixed Memory Leak in R2DecDecompiler::decompileAt (#2257)
This commit is contained in:
parent
d33eae4cb9
commit
d26e48f3f5
@ -57,14 +57,14 @@ void R2DecDecompiler::decompileAt(RVA addr)
|
|||||||
if (lineObject.isEmpty()) {
|
if (lineObject.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
RCodeAnnotation *annotationi = new RCodeAnnotation;
|
RCodeAnnotation annotationi = { 0 };
|
||||||
annotationi->start = codeString.length();
|
annotationi.start = codeString.length();
|
||||||
codeString.append(lineObject["str"].toString() + "\n");
|
codeString.append(lineObject["str"].toString() + "\n");
|
||||||
annotationi->end = codeString.length();
|
annotationi.end = codeString.length();
|
||||||
bool ok;
|
bool ok;
|
||||||
annotationi->type = R_CODE_ANNOTATION_TYPE_OFFSET;
|
annotationi.type = R_CODE_ANNOTATION_TYPE_OFFSET;
|
||||||
annotationi->offset.offset = lineObject["offset"].toVariant().toULongLong(&ok);
|
annotationi.offset.offset = lineObject["offset"].toVariant().toULongLong(&ok);
|
||||||
r_annotated_code_add_annotation(code, annotationi);
|
r_annotated_code_add_annotation(code, &annotationi);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &line : json["errors"].toArray()) {
|
for (const auto &line : json["errors"].toArray()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user