mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
whoops, returning a free'd variable is really not what I meant...
This commit is contained in:
parent
0b6806d7f7
commit
ae8367dc3e
|
@ -37,6 +37,5 @@ unsigned char * hex_string_to_bin(char hex_string[])
|
|||
for(i = 0; i < len; ++i, pos+=2)
|
||||
sscanf(pos,"%2hhx",&val[i]);
|
||||
|
||||
free(val);
|
||||
return val;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,9 @@ void line_eval(char *line)
|
|||
for (i = 0; i < 128; i++)
|
||||
temp_id[i] = line[i+prompt_offset];
|
||||
|
||||
int num = m_addfriend(hex_string_to_bin(temp_id), (uint8_t*)"Install Gentoo", sizeof("Install Gentoo"));
|
||||
unsigned char *bin_string = hex_string_to_bin(temp_id);
|
||||
int num = m_addfriend(bin_string, (uint8_t*)"Install Gentoo", sizeof("Install Gentoo"));
|
||||
free(bin_string);
|
||||
char numstring[100];
|
||||
switch (num) {
|
||||
case -1:
|
||||
|
@ -456,7 +458,9 @@ int main(int argc, char *argv[])
|
|||
else
|
||||
exit(1);
|
||||
|
||||
DHT_bootstrap(bootstrap_ip_port, hex_string_to_bin(argv[3]));
|
||||
unsigned char *binary_string = hex_string_to_bin(argv[3]);
|
||||
DHT_bootstrap(bootstrap_ip_port, binary_string);
|
||||
free(binary_string);
|
||||
nodelay(stdscr, TRUE);
|
||||
while(true) {
|
||||
if (on == 0 && DHT_isconnected()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user