Skip to content

Commit

Permalink
Fix potential memory issues identified by Valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Sep 22, 2015
1 parent 4bc2030 commit 8735fb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/backend/machobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,9 @@ void MachObj::addrel(int seg, targ_size_t offset, symbol *targsym,
unsigned targseg, int rtype, int val)
{
Relocation rel;
#ifdef DEBUG
memset(&rel, 0, sizeof(rel));
#endif
rel.offset = offset;
rel.targsym = targsym;
rel.targseg = targseg;
Expand Down
2 changes: 1 addition & 1 deletion src/dmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public:
scope Mangler v = new Mangler(&buf2);
v.paramsToDecoBuffer(t.arguments);
int len = cast(int)buf2.offset;
buf.printf("%d%.*s", len, len, buf2.extractData());
buf.printf("%d%.*s", len, len, buf2.extractString());
}

void visit(TypeNull t)
Expand Down

0 comments on commit 8735fb8

Please sign in to comment.