]> sigrok.org Git - libsigrok.git/commit
Use g_try_malloc/g_free/g_strdup consistently.
authorUwe Hermann <redacted>
Sat, 11 Feb 2012 19:06:46 +0000 (20:06 +0100)
committerUwe Hermann <redacted>
Sat, 11 Feb 2012 21:34:16 +0000 (22:34 +0100)
commit133a37bfba1a7e1423716b2b872d3bb82a2e64d9
treef0eef1708051d61d308611fca7bec817b7c41ec9
parentcd853ff0b2b0ad2643d65e73159661e1a3c6bc66
Use g_try_malloc/g_free/g_strdup consistently.

Avoid plain malloc()/free() in sr/srd, especially in the API calls.
Also avoid g_malloc*() in favor of g_try_malloc*().

Use g_strdup() instead of strdup() so that we can use g_free()
consistently everywhere.

Exceptions: Stuff that is allocated via other libs (not using glib),
should also be properly free'd using the respective free-ing function
(instead of g_free()). Examples: Stuff allocated by libusb, libftdi, etc.

Also, use sr_err() instead of sr_warn() for actual errors. sr_warn() is
meant for non-fatal/uncritical warnings.
25 files changed:
hardware/alsa/alsa.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/chronovu-la8.c
hardware/common/ezusb.c
hardware/common/serial.c
hardware/link-mso19/link-mso19.c
hardware/openbench-logic-sniffer/ols.c
hardware/saleae-logic/saleae-logic.c
hardware/zeroplus-logic-cube/zeroplus.c
hwplugin.c
input/chronovu_la8.c
output/analog.c
output/binary.c
output/chronovu_la8.c
output/gnuplot.c
output/ols.c
output/text/ascii.c
output/text/bits.c
output/text/hex.c
output/text/text.c
output/vcd.c
session.c
session_driver.c
session_file.c
strutil.c