Fri, 10 Jun 2022 20:42:36 -0500
fix memory leak when using purple accounts
Testing Done:
ran test_account_manager and test_notification (from /r/1502 where I first encountered that leak) in valgrind -> no more leak and no new invalid read/write
Reviewed at https://reviews.imfreedom.org/r/1503/
|
40743
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * This library is free software; you can redistribute it and/or |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * modify it under the terms of the GNU Lesser General Public |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * License as published by the Free Software Foundation; either |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * version 2 of the License, or (at your option) any later version. |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * This library is distributed in the hope that it will be useful, |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * Lesser General Public License for more details. |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU Lesser General Public |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * License along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | */ |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION) |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | # error "only <purple.h> may be included directly" |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | #endif |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #ifndef PURPLE_NOOP_CREDENTIAL_PROVIDER_H |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | #define PURPLE_NOOP_CREDENTIAL_PROVIDER_H |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #include <glib-object.h> |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | #include <purplecredentialprovider.h> |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | G_BEGIN_DECLS |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | /** |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | * PurpleNoopCredentialProvider: |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | * #PurpleNoopCredentialProvider is a #PurpleCredentialProvider that does not |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | * actually provider credentials. It is used to implement the default behavior |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | * of requiring users to input passwords. |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * Since: 3.0.0 |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | */ |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | |
|
41010
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
43 | /** |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
44 | * PURPLE_TYPE_NOOP_CREDENTIAL_PROVIDER: |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
45 | * |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
46 | * The standard _TYPE_ macro for #PurpleNoopCredentialProvider. |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
47 | * |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
48 | * Since: 3.0.0 |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
49 | */ |
|
40743
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | #define PURPLE_TYPE_NOOP_CREDENTIAL_PROVIDER (purple_noop_credential_provider_get_type()) |
|
41010
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
51 | |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
52 | /** |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
53 | * purple_noop_credential_provider_get_type: |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
54 | * |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
55 | * Gets the #GType of #PurpleNoopCredentialProvider. |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
56 | * |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
57 | * Returns: The #GType of #PurpleNoopCredentialProvider. |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
58 | * |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
59 | * Since: 3.0.0 |
|
d0abbb616bea
A bunch of random libpurple documentation fixes
Gary Kramlich <grim@reaperworld.com>
parents:
40743
diff
changeset
|
60 | */ |
|
40743
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | G_DECLARE_FINAL_TYPE(PurpleNoopCredentialProvider, |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | purple_noop_credential_provider, |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | PURPLE, NOOP_CREDENTIAL_PROVIDER, PurpleCredentialProvider) |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | /** |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | * purple_noop_credential_provider_new: |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | * Creates a new #PurpleNoopCredentialProvider instance. You typically will |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | * not need to call this directly as #PurpleCredentialManager will create one |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | * for itself. |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | * |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | * Returns: (transfer full): The new #PurpleNoopCredentialProvider instance. |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | */ |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | PurpleCredentialProvider *purple_noop_credential_provider_new(void); |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | G_END_DECLS |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | |
|
7aa6153abf4d
Create a no operation credential provider and fix a number of other issues
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | #endif /* PURPLE_NOOP_CREDENTIAL_PROVIDER */ |