diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2015-03-07 19:12:15 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2015-04-01 00:25:51 +0200 |
commit | 077fa8acbcb8b585af6f5323f16221940a27a72e (patch) | |
tree | 564a091540e1d929e9e019a7f89658d1de55af2f /util.c | |
parent | c052046717c09758bbdf62819e0029dddcae7159 (diff) | |
download | libsigrokdecode-077fa8acbcb8b585af6f5323f16221940a27a72e.tar.gz libsigrokdecode-077fa8acbcb8b585af6f5323f16221940a27a72e.zip |
Use g_malloc*() consistently, simplify error handling.
Use g_malloc*() for small allocations and assume they always
succeed. Simplify error handling in a few places accordingly.
Document the rules in the README file.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -145,11 +145,7 @@ SRD_PRIV int py_str_as_str(const PyObject *py_str, char **outstr) goto err_out; } - if (!(*outstr = g_strdup(str))) { - srd_dbg("Failed to g_malloc() outstr."); - ret = SRD_ERR_MALLOC; - goto err_out; - } + *outstr = g_strdup(str); err_out: if (py_encstr) |