Bug 190867 - [WPE][GTK] Cleanups to the certificate decoder
Summary: [WPE][GTK] Cleanups to the certificate decoder
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Claudio Saavedra
Depends on:
Reported: 2018-10-24 04:16 PDT by Claudio Saavedra
Modified: 2018-10-24 07:56 PDT (History)
3 users (show)

See Also:

Patch (2.52 KB, patch)
2018-10-24 04:17 PDT, Claudio Saavedra
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Saavedra 2018-10-24 04:16:40 PDT
[WPE][GTK] Cleanups to the certificate decoder
Comment 1 Claudio Saavedra 2018-10-24 04:17:01 PDT
Created attachment 353031 [details]
Comment 2 Claudio Saavedra 2018-10-24 06:45:36 PDT
Comment on attachment 353031 [details]

Clearing flags on attachment: 353031

Committed r237380: <https://trac.webkit.org/changeset/237380>
Comment 3 Claudio Saavedra 2018-10-24 06:45:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Michael Catanzaro 2018-10-24 07:56:54 PDT
Comment on attachment 353031 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=353031&action=review

> Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp:103
> +        GRefPtr<GByteArray> certificateData = g_byte_array_sized_new(certificateDataReference.size());

Now, because you did not use adotpGRef(), there are two refs to the GByteArray: the original one, and the GRefPtr's.

> Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp:104
> +        certificateData = g_byte_array_append(certificateData.get(), certificateDataReference.data(), certificateDataReference.size());

So now the GRefPtr would drop its ref on the original GByteArray and ref the new one. But the original ref on the original GByteArray has been lost. Right? I think you need to use adoptGRef() on the line above.