Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
alterator-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kozyrev Yuri
alterator-manager
Commits
a728fdf6
Commit
a728fdf6
authored
1 year ago
by
Ivan Savin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: add g_free after g_variant_get.
Add g_free() for newly-allocated copy of the string after g_variant_get().
parent
9008dd79
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alterator_manager_default_interfaces.c
+16
-4
16 additions, 4 deletions
alterator_manager_default_interfaces.c
with
16 additions
and
4 deletions
alterator_manager_default_interfaces.c
+
16
−
4
View file @
a728fdf6
...
...
@@ -37,7 +37,7 @@ static void method_get_objects(GVariant *parameters,
GHashTable
*
interfaces
;
gchar
*
node_name
;
gchar
*
interface_name
;
gchar
*
param
;
gchar
*
param
=
NULL
;
gchar
*
object_path
;
builder
=
g_variant_builder_new
(
G_VARIANT_TYPE
(
"ao"
));
...
...
@@ -68,6 +68,9 @@ static void method_get_objects(GVariant *parameters,
g_variant_new
(
"(ao)"
,
builder
));
g_variant_builder_unref
(
builder
);
if
(
param
!=
NULL
)
{
g_free
(
param
);
}
}
static
void
method_get_signals
(
GVariant
*
parameters
,
...
...
@@ -86,8 +89,8 @@ static void method_get_signals(GVariant *parameters,
gchar
*
method_name
;
gchar
*
attr_name
;
gchar
*
attr_val
;
gchar
*
interface_param
;
gchar
*
method_param
;
gchar
*
interface_param
=
NULL
;
gchar
*
method_param
=
NULL
;
builder
=
g_variant_builder_new
(
G_VARIANT_TYPE
(
"as"
));
g_variant_get
(
parameters
,
"(&s&s)"
,
&
interface_param
,
&
method_param
);
...
...
@@ -137,6 +140,12 @@ static void method_get_signals(GVariant *parameters,
g_variant_new
(
"(as)"
,
builder
));
g_variant_builder_unref
(
builder
);
if
(
interface_param
!=
NULL
)
{
g_free
(
interface_param
);
}
if
(
method_param
!=
NULL
)
{
g_free
(
method_param
);
}
}
static
void
method_get_interfaces
(
GVariant
*
parameters
,
...
...
@@ -144,7 +153,7 @@ static void method_get_interfaces(GVariant *parameters,
{
GVariantBuilder
*
builder
;
GHashTable
*
interfaces
=
NULL
;
gchar
*
param
;
gchar
*
param
=
NULL
;
gchar
*
node_name
;
builder
=
g_variant_builder_new
(
G_VARIANT_TYPE
(
"as"
));
...
...
@@ -170,6 +179,9 @@ static void method_get_interfaces(GVariant *parameters,
g_variant_new
(
"(as)"
,
builder
));
g_variant_builder_unref
(
builder
);
if
(
param
!=
NULL
)
{
g_free
(
param
);
}
}
static
gboolean
authorization_check
(
GDBusMethodInvocation
*
invocation
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment