comparison src/gaim_buffer.c @ 13828:71a6a6b22149

[gaim-migrate @ 16273] This fixes a crash when gaim_circ_buffer_destroy is called with a NULL circular buffer. I'm using g_return_if_fail so it still reports a warning, because it is possible that the circumstance in question shouldn't even come up. If that isn't the case, we can make it fail silently. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Sat, 17 Jun 2006 23:22:30 +0000
parents 64bae3cbec8d
children
comparison
equal deleted inserted replaced
13827:6c3c8d0d389f 13828:71a6a6b22149
32 buf->growsize = growsize ? growsize : DEFAULT_BUF_SIZE; 32 buf->growsize = growsize ? growsize : DEFAULT_BUF_SIZE;
33 return buf; 33 return buf;
34 } 34 }
35 35
36 void gaim_circ_buffer_destroy(GaimCircBuffer *buf) { 36 void gaim_circ_buffer_destroy(GaimCircBuffer *buf) {
37 g_return_if_fail(buf);
37 g_free(buf->buffer); 38 g_free(buf->buffer);
38 g_free(buf); 39 g_free(buf);
39 } 40 }
40 41
41 static void grow_circ_buffer(GaimCircBuffer *buf, gsize len) { 42 static void grow_circ_buffer(GaimCircBuffer *buf, gsize len) {