]> sigrok.org Git - sigrok-cli.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)
commitc2c4a0def11bd2a589aa62f8f501ff20ef5f99e4
tree9d15af4c78d695f91d6b56eca222b0e0c34b230c
parent878e90d9779a1881840454e2ad7bd90a4b470221
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.
parsers.c
sigrok-cli.c