diff options
Diffstat (limited to 'camel/camel-exception.c')
| -rw-r--r-- | camel/camel-exception.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/camel/camel-exception.c b/camel/camel-exception.c index f6e6acf78b..fee7c541aa 100644 --- a/camel/camel-exception.c +++ b/camel/camel-exception.c @@ -166,6 +166,9 @@ camel_exception_set (CamelException *ex, ExceptionId id, const char *desc) { + if (camel_debug("exception")) + printf("CamelException.set(%p, %d, '%s')\n", ex, id, desc); + if (!ex) return; @@ -209,24 +212,24 @@ camel_exception_setv (CamelException *ex, ...) { va_list args; - char *old; + char *desc; + + va_start(args, format); + desc = g_strdup_vprintf (format, args); + va_end (args); if (camel_debug("exception")) - printf("CamelException.setv(%p, %d, '%s')\n", ex, id, format); + printf("CamelException.setv(%p, %d, '%s')\n", ex, id, desc); - if (!ex) + if (!ex) { + g_free(desc); return; + } CAMEL_EXCEPTION_LOCK(exception); - - old = ex->desc; - - va_start(args, format); - ex->desc = g_strdup_vprintf (format, args); - va_end (args); - g_free (old); - + g_free(ex->desc); + ex->desc = desc; ex->id = id; CAMEL_EXCEPTION_UNLOCK(exception); |
