mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
In line_split set *output _after_ calling remove_newline because it
could reallocate rec->str, fixes bug #439. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4381 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
da9582e5aa
commit
746649ae77
@ -90,6 +90,7 @@ static int remove_newline(LINEBUF_REC *rec)
|
||||
int line_split(const char *data, int len, char **output, LINEBUF_REC **buffer)
|
||||
{
|
||||
LINEBUF_REC *rec;
|
||||
int ret;
|
||||
|
||||
g_return_val_if_fail(data != NULL, -1);
|
||||
g_return_val_if_fail(output != NULL, -1);
|
||||
@ -122,8 +123,9 @@ int line_split(const char *data, int len, char **output, LINEBUF_REC **buffer)
|
||||
}
|
||||
}
|
||||
|
||||
ret = remove_newline(rec);
|
||||
*output = rec->str;
|
||||
return remove_newline(rec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void line_split_free(LINEBUF_REC *buffer)
|
||||
|
Loading…
Reference in New Issue
Block a user