ethumb client - fix access to pending struct that has been freed
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 10 Aug 2014 04:26:33 +0000 (13:26 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 10 Aug 2014 04:26:33 +0000 (13:26 +0900)
th pending cancel may call callbacks... which can mess with the list
and thus the pending_add we have, sso do our work before calling this
(like set pending_call to NULL).

src/lib/ethumb_client/ethumb_client.c

index dbc9681..fa5ff54 100644 (file)
@@ -1112,8 +1112,12 @@ ethumb_client_generate_cancel(Ethumb_Client *client, int id, Ethumb_Client_Gener
              continue;
           }
         if (pending_add->pending_call)
-          eldbus_pending_cancel(pending_add->pending_call);
-        pending_add->pending_call = NULL;
+          {
+             Eldbus_Pending *call = pending_add->pending_call;
+
+             pending_add->pending_call = NULL;
+             eldbus_pending_cancel(call);
+          }
         found = 1;
         break;
      }