mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
Always use g_realloc rather than using g_malloc when the pointer
is NULL. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4794 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d39d949b79
commit
e8ae6d827d
@ -43,8 +43,7 @@ static void linebuf_append(LINEBUF_REC *rec, const char *data, int len)
|
||||
{
|
||||
if (rec->len+len > rec->alloc) {
|
||||
rec->alloc = nearest_power(rec->len+len);;
|
||||
rec->str = rec->str == NULL ? g_malloc(rec->alloc) :
|
||||
g_realloc(rec->str, rec->alloc);
|
||||
rec->str = g_realloc(rec->str, rec->alloc);
|
||||
}
|
||||
|
||||
memcpy(rec->str + rec->len, data, len);
|
||||
|
Loading…
Reference in New Issue
Block a user