From e8ae6d827d924b3e40891da7a56b99b85e000e18 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 2 Apr 2008 11:07:03 +0000 Subject: 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 --- src/core/line-split.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/line-split.c b/src/core/line-split.c index a93ce8e8..0ee87d23 100644 --- a/src/core/line-split.c +++ b/src/core/line-split.c @@ -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); -- cgit v1.2.3