mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02: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
1 changed files with 1 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue