Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
3c458d22
Commit
3c458d22
authored
Feb 14, 2009
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more memory leaks.
parent
aa3a4c8d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
bplist.c
src/bplist.c
+7
-0
plist.c
src/plist.c
+2
-1
No files found.
src/bplist.c
View file @
3c458d22
...
@@ -285,6 +285,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
...
@@ -285,6 +285,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
return
NULL
;
return
NULL
;
plist_get_uint_val
(
size_node
,
&
size
);
plist_get_uint_val
(
size_node
,
&
size
);
plist_free
(
size_node
);
}
}
return
parse_data_node
(
object
,
size
);
return
parse_data_node
(
object
,
size
);
...
@@ -294,6 +295,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
...
@@ -294,6 +295,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
return
NULL
;
return
NULL
;
plist_get_uint_val
(
size_node
,
&
size
);
plist_get_uint_val
(
size_node
,
&
size
);
plist_free
(
size_node
);
}
}
return
parse_string_node
(
object
,
size
);
return
parse_string_node
(
object
,
size
);
...
@@ -303,6 +305,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
...
@@ -303,6 +305,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
return
NULL
;
return
NULL
;
plist_get_uint_val
(
size_node
,
&
size
);
plist_get_uint_val
(
size_node
,
&
size
);
plist_free
(
size_node
);
}
}
return
parse_unicode_node
(
object
,
size
);
return
parse_unicode_node
(
object
,
size
);
...
@@ -313,6 +316,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
...
@@ -313,6 +316,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
return
NULL
;
return
NULL
;
plist_get_uint_val
(
size_node
,
&
size
);
plist_get_uint_val
(
size_node
,
&
size
);
plist_free
(
size_node
);
}
}
return
parse_array_node
(
object
,
size
,
dict_size
);
return
parse_array_node
(
object
,
size
,
dict_size
);
...
@@ -323,6 +327,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
...
@@ -323,6 +327,7 @@ static plist_t parse_bin_node(char *object, uint8_t dict_size, char **next_objec
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
if
(
plist_get_node_type
(
size_node
)
!=
PLIST_UINT
)
return
NULL
;
return
NULL
;
plist_get_uint_val
(
size_node
,
&
size
);
plist_get_uint_val
(
size_node
,
&
size
);
plist_free
(
size_node
);
}
}
return
parse_dict_node
(
object
,
size
,
dict_size
);
return
parse_dict_node
(
object
,
size
,
dict_size
);
default:
default:
...
@@ -868,6 +873,8 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
...
@@ -868,6 +873,8 @@ void plist_to_bin(plist_t plist, char **plist_bin, uint32_t * length)
//free intermediate objects
//free intermediate objects
g_hash_table_foreach_remove
(
ref_table
,
free_index
,
NULL
);
g_hash_table_foreach_remove
(
ref_table
,
free_index
,
NULL
);
g_ptr_array_free
(
objects
,
TRUE
);
g_hash_table_destroy
(
ref_table
);
//write offsets
//write offsets
offset_size
=
get_needed_bytes
(
bplist_buff
->
len
);
offset_size
=
get_needed_bytes
(
bplist_buff
->
len
);
...
...
src/plist.c
View file @
3c458d22
...
@@ -65,6 +65,7 @@ static void plist_free_node(GNode * node, gpointer none)
...
@@ -65,6 +65,7 @@ static void plist_free_node(GNode * node, gpointer none)
free
(
data
);
free
(
data
);
}
}
node
->
data
=
NULL
;
node
->
data
=
NULL
;
g_node_children_foreach
(
node
,
G_TRAVERSE_ALL
,
plist_free_node
,
NULL
);
}
}
plist_t
plist_new_dict
()
plist_t
plist_new_dict
()
...
@@ -144,7 +145,7 @@ static plist_t plist_add_sub_element(plist_t node, plist_type type, const void *
...
@@ -144,7 +145,7 @@ static plist_t plist_add_sub_element(plist_t node, plist_type type, const void *
void
plist_free
(
plist_t
plist
)
void
plist_free
(
plist_t
plist
)
{
{
g_node_children_foreach
(
plist
,
G_TRAVERSE_ALL
,
plist_free_node
,
NULL
);
plist_free_node
(
plist
,
NULL
);
g_node_destroy
(
plist
);
g_node_destroy
(
plist
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment