Browse Source

Fix minor uninitialised ram and leak issues

master
Con Kolivas 11 years ago
parent
commit
d4e6668865
  1. 3
      src/bitcoin.c
  2. 1
      src/libckpool.c
  3. 1
      src/stratifier.c

3
src/bitcoin.c

@ -109,8 +109,7 @@ static bool gbt_merkle_bins(gbtbase_t *gbt, json_t *transaction_arr)
len += strlen(txn);
}
gbt->txn_data = ckalloc(len + 1);
gbt->txn_data[len] = '\0';
gbt->txn_data = ckzalloc(len + 1);
for (i = 0; i < gbt->transactions; i++) {
char binswap[32];

1
src/libckpool.c

@ -375,6 +375,7 @@ int connect_socket(char *url, char *port)
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
memset(&servinfobase, 0, sizeof(struct addrinfo));
servinfo = &servinfobase;
if (getaddrinfo(url, port, &hints, &servinfo) != 0) {

1
src/stratifier.c

@ -2035,6 +2035,7 @@ static void load_users(ckpool_t *ckp)
LOGDEBUG("Added user %s with %lu shares", instance->username, pplns_shares);
}
closedir(dp);
}
int stratifier(proc_instance_t *pi)

Loading…
Cancel
Save