]> sigrok.org Git - libsigrok.git/commit
Replace g_malloc{0,} with g_try_malloc{0,}.
authorUwe Hermann <redacted>
Sat, 16 Apr 2011 12:17:51 +0000 (14:17 +0200)
committerUwe Hermann <redacted>
Sat, 16 Apr 2011 16:08:15 +0000 (18:08 +0200)
commitb53738baf76219237e0a6629905981d7a1f2508e
tree9b9c08b530f9f26511e26c82bcdab27db293cf36
parent50959ddcdc455c930397fbc9f85c3a745ff45fda
Replace g_malloc{0,} with g_try_malloc{0,}.

The g_malloc()/g_malloc0() versions exit/segfault if not enough memory
is available, which is not a good thing in libsigrok.

Instead, we use the g_try_malloc()/g_try_malloc0() variants, which
return NULL if not enough memory is available, so that the caller can
handle the error properly.
datastore.c
device.c
hardware/asix-sigma/asix-sigma.c
hardware/openbench-logic-sniffer/ols.c
hardware/saleae-logic/saleae-logic.c
hardware/zeroplus-logic-cube/zeroplus.c
output/output_ols.c
session_driver.c
session_file.c
strutil.c