<p dir="ltr">Both patches in this series look good to me.<br>
--Jason Ekstrand</p>
<div class="gmail_quote">On Mar 28, 2013 1:49 PM, "Rob Bradford" <<a href="mailto:robert.bradford@intel.com">robert.bradford@intel.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Rob Bradford <<a href="mailto:rob@linux.intel.com">rob@linux.intel.com</a>><br>
<br>
Reorder the error handling in the case that closure is NULL due to ENOMEM to<br>
ensure that we can safely call wl_closure_lookup_objects on the second test.<br>
Prior to this reordering the closure would be deferenced in the ENOMEM case<br>
due to the invocation of the second half of the logical OR check.<br>
---<br>
 src/wayland-server.c | 10 +++++-----<br>
 1 file changed, 5 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/wayland-server.c b/src/wayland-server.c<br>
index dcb4435..384b465 100644<br>
--- a/src/wayland-server.c<br>
+++ b/src/wayland-server.c<br>
@@ -260,8 +260,11 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)<br>
                                                  &client->objects, message);<br>
                len -= size;<br>
<br>
-               if ((closure == NULL && errno == EINVAL) ||<br>
-                   wl_closure_lookup_objects(closure, &client->objects) < 0) {<br>
+               if (closure == NULL && errno == ENOMEM) {<br>
+                       wl_resource_post_no_memory(resource);<br>
+                       break;<br>
+               } else if ((closure == NULL && errno == EINVAL) ||<br>
+                          wl_closure_lookup_objects(closure, &client->objects) < 0) {<br>
                        wl_resource_post_error(client->display_resource,<br>
                                               WL_DISPLAY_ERROR_INVALID_METHOD,<br>
                                               "invalid arguments for %s@%u.%s",<br>
@@ -269,9 +272,6 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)<br>
                                               object->id,<br>
                                               message->name);<br>
                        break;<br>
-               } else if (closure == NULL && errno == ENOMEM) {<br>
-                       wl_resource_post_no_memory(resource);<br>
-                       break;<br>
                }<br>
<br>
                if (wl_debug)<br>
--<br>
1.8.1.2<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>