changeset 19272:012d11e9cb67

push-notification: OX driver error handling fix - garbage metadata was returned on failure.
author Timo Sirainen <tss@iki.fi>
date Fri, 02 Oct 2015 11:17:53 +0300
parents 990030864e16
children 5e667cce0842
files src/plugins/push-notification/push-notification-driver-ox.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/push-notification/push-notification-driver-ox.c	Thu Oct 01 21:02:55 2015 -0600
+++ b/src/plugins/push-notification/push-notification-driver-ox.c	Fri Oct 02 11:17:53 2015 +0300
@@ -168,12 +168,14 @@
     if (!use_existing_txn) {
         mailbox_free(&inbox);
     }
+    if (!success)
+	    return NULL;
 
     dconfig->cached_ox_metadata =
         p_strdup(dtxn->ptxn->muser->pool, attr.value);
     dconfig->cached_ox_metadata_timestamp = ioloop_time;
 
-    return (success == TRUE) ? attr.value : NULL;
+    return dconfig->cached_ox_metadata;
 }
 
 static bool push_notification_driver_ox_begin_txn