Skip to content

Commit

Permalink
object: Change malloc to calloc for lx, ne internals
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Jun 6, 2024
1 parent 1b8d611 commit 3bb321d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/adbg/object/format/lx.d
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ int adbg_object_lx_load(adbg_object_t *o, uint e_lfanew) {
version (Trace) trace("o=%p", o);

o.format = AdbgObject.lx;
o.internal = malloc(internal_lx_t.sizeof);
o.internal = calloc(1, internal_lx_t.sizeof);
if (o.internal == null)
return adbg_oops(AdbgError.crt);
if (adbg_object_read_at(o, e_lfanew, o.internal, lx_header_t.sizeof) < 0)
Expand Down
2 changes: 1 addition & 1 deletion src/adbg/object/format/ne.d
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ int adbg_object_ne_load(adbg_object_t *o, uint e_lfanew) {
version (Trace) trace("o=%p", o);

o.format = AdbgObject.ne;
o.internal = malloc(internal_ne_t.sizeof);
o.internal = calloc(1, internal_ne_t.sizeof);
if (o.internal == null)
return adbg_oops(AdbgError.crt);
if (adbg_object_read_at(o, e_lfanew, o.internal, ne_header_t.sizeof) < 0) {
Expand Down

0 comments on commit 3bb321d

Please sign in to comment.