[Spice-devel,spice-0.8] client: Plug some leaks

Submitted by Zeeshan Ali (Khattak) on Aug. 17, 2011, 9:35 p.m.

Details

Message ID 1313591717-10144-1-git-send-email-zeeshanak@gnome.org
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Zeeshan Ali (Khattak) Aug. 17, 2011, 9:35 p.m.
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>

---
 client/red_channel.cpp    |    1 +
 client/x11/red_window.cpp |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/client/red_channel.cpp b/client/red_channel.cpp
index f4cdf52..ace4a03 100644
--- a/client/red_channel.cpp
+++ b/client/red_channel.cpp
@@ -192,6 +192,7 @@  void RedChannelBase::link(uint32_t connection_id, const std::string& password,
     }
 
     BIO_free(bioKey);
+    EVP_PKEY_free(pubkey);
 
     recive((uint8_t*)&link_res, sizeof(link_res));
     if (link_res != SPICE_LINK_ERR_OK) {
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index d53a92f..f3ff95f 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -1313,6 +1313,7 @@  void RedWindow_p::move_to_current_desktop()
                            &bytes_after_return, &prop_return) == Success &&
                                          actual_type_return != None && actual_format_return == 32) {
         desktop = *(uint32_t *)prop_return;
+        XFree(prop_return);
     } else {
         DBG(0, "get current desktop failed");
     }

Comments

Hey,

These fixes duplicate fixes that already went into master :-/ See commits
d7d0a3a98e and 0d4bd5504.

On Wed, Aug 17, 2011 at 05:35:17PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
> diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
> index d53a92f..f3ff95f 100644
> --- a/client/x11/red_window.cpp
> +++ b/client/x11/red_window.cpp
> @@ -1313,6 +1313,7 @@ void RedWindow_p::move_to_current_desktop()
>                             &bytes_after_return, &prop_return) == Success &&
>                                           actual_type_return != None && actual_format_return == 32) {
>          desktop = *(uint32_t *)prop_return;
> +        XFree(prop_return);

prop_return will still be leaked when actual_type_return is None or
when actual_format_return is != 32 (maybe that can't happen ?)

Christophe
On Wed, Aug 17, 2011 at 7:35 PM, Christophe Fergeau <cfergeau@redhat.com> wrote:
> Hey,

  Yo,

> These fixes duplicate fixes that already went into master :-/ See commits
> d7d0a3a98e and 0d4bd5504.

  Darn! Looks like you did a better job even. :)