mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
Add memsets after allocation of all Backend implementors.
Now every struct that implements the Backend trait is completely cleared before we start initialising any of its fields. This will mean I can add new fields that default to 0 or NULL, without having to mess around initialising them explicitly everywhere.
This commit is contained in:
@ -232,6 +232,7 @@ static char *conpty_init(const BackendVtable *vt, Seat *seat,
|
||||
seat_set_trust_status(seat, false);
|
||||
|
||||
conpty = snew(ConPTY);
|
||||
memset(conpty, 0, sizeof(ConPTY));
|
||||
conpty->pseudoconsole = pcon;
|
||||
pcon_needs_cleanup = false;
|
||||
conpty->outpipe = in_w;
|
||||
|
@ -212,6 +212,7 @@ static char *serial_init(const BackendVtable *vt, Seat *seat,
|
||||
seat_set_trust_status(seat, false);
|
||||
|
||||
serial = snew(Serial);
|
||||
memset(serial, 0, sizeof(Serial));
|
||||
serial->port = INVALID_HANDLE_VALUE;
|
||||
serial->out = serial->in = NULL;
|
||||
serial->bufsize = 0;
|
||||
|
Reference in New Issue
Block a user