summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2012-02-11 20:06:46 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2012-02-11 22:34:16 +0100
commit56bf4c20afc2785f8cdf75e386159e23fa2c1acf (patch)
tree410505294681081a727fa35b9778aa220dc35638 /util.c
parenta8b72b05cad9fd63e52079acb395a6694ed5f6b6 (diff)
downloadlibsigrokdecode-56bf4c20afc2785f8cdf75e386159e23fa2c1acf.tar.gz
libsigrokdecode-56bf4c20afc2785f8cdf75e386159e23fa2c1acf.zip
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.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 27a5e07..cd77fc1 100644
--- a/util.c
+++ b/util.c
@@ -156,7 +156,7 @@ err_out:
/**
* Convert a Python list of unicode strings to a NULL-terminated UTF8-encoded
- * char * array. The caller must free each string when finished.
+ * char * array. The caller must g_free() each string when finished.
*
* @param py_strlist The list object.
* @param outstr ptr to char ** storage to be filled in.