From 077fa8acbcb8b585af6f5323f16221940a27a72e Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 7 Mar 2015 19:12:15 +0100 Subject: 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. --- util.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index c1b9040..764474b 100644 --- a/util.c +++ b/util.c @@ -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) -- cgit v1.2.3-70-g09d2