Merge lp:~charlesk/indicator-messages/lp-1493534-fix-null-error-dereference into lp:indicator-messages

Proposed by Charles Kerr on 2016-05-16
Status: Approved
Approved by: Antti Kaijanmäki on 2016-05-16
Approved revision: 449
Proposed branch: lp:~charlesk/indicator-messages/lp-1493534-fix-null-error-dereference
Merge into: lp:indicator-messages
Diff against target: 17 lines (+6/-2)
1 file modified
src/im-application-list.c (+6/-2)
To merge this branch: bzr merge lp:~charlesk/indicator-messages/lp-1493534-fix-null-error-dereference
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration 2016-05-16 Approve on 2016-05-16
Antti Kaijanmäki (community) Approve on 2016-05-16
Pete Woods 2016-05-16 Pending
Review via email: mp+294846@code.launchpad.net

This proposal supersedes a proposal from 2015-09-09.

Commit message

When parsing the async response of list_sources(), test GError for NULL before dereferencing it

Description of the change

When parsing the async response of list_sources(), test GError for NULL before dereferencing it.

This should've landed awhile back. Queuing it up now for spring cleaning.

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Pete Woods (pete-woods) wrote : Posted in a previous version of this proposal

Seems a bit convoluted, but okay :)

review: Approve
Antti Kaijanmäki (kaijanmaki) wrote :

lgtm.

review: Approve

Unmerged revisions

449. By Charles Kerr on 2015-09-10

fix typo

448. By Charles Kerr on 2015-09-09

test the GError for NULL before dereferencing it

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/im-application-list.c'
2--- src/im-application-list.c 2015-05-05 16:47:39 +0000
3+++ src/im-application-list.c 2016-05-16 21:41:57 +0000
4@@ -1004,8 +1004,12 @@
5 }
6 else
7 {
8- g_warning ("could not fetch the list of sources: %s", error->message);
9- g_error_free (error);
10+ if ((error != NULL) && (error->message != NULL))
11+ g_warning ("could not fetch the list of sources: %s", error->message);
12+ else
13+ g_warning ("could not fetch the list of sources");
14+
15+ g_clear_error (&error);
16 }
17 }
18

Subscribers

People subscribed via source and target branches