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
e5e5f21c
Commit
e5e5f21c
authored
Aug 12, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some memory leaks
parent
94eca787
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
ifuse.c
src/ifuse.c
+10
-12
lockdown.c
src/lockdown.c
+2
-1
main.c
src/main.c
+3
-0
No files found.
src/ifuse.c
View file @
e5e5f21c
...
@@ -42,6 +42,9 @@
...
@@ -42,6 +42,9 @@
GHashTable
*
file_handles
;
GHashTable
*
file_handles
;
int
fh_index
=
0
;
int
fh_index
=
0
;
iPhone
*
phone
=
NULL
;
lockdownd_client
*
control
=
NULL
;
int
debug
=
0
;
int
debug
=
0
;
static
int
ifuse_getattr
(
const
char
*
path
,
struct
stat
*
stbuf
)
{
static
int
ifuse_getattr
(
const
char
*
path
,
struct
stat
*
stbuf
)
{
...
@@ -175,14 +178,13 @@ static int ifuse_release(const char *path, struct fuse_file_info *fi){
...
@@ -175,14 +178,13 @@ static int ifuse_release(const char *path, struct fuse_file_info *fi){
void
*
ifuse_init
(
struct
fuse_conn_info
*
conn
)
{
void
*
ifuse_init
(
struct
fuse_conn_info
*
conn
)
{
int
port
=
0
;
int
port
=
0
;
char
*
host_id
=
NULL
;
AFClient
*
afc
=
NULL
;
AFClient
*
afc
=
NULL
;
conn
->
async_read
=
0
;
conn
->
async_read
=
0
;
file_handles
=
g_hash_table_new
(
g_int_hash
,
g_int_equal
);
file_handles
=
g_hash_table_new
(
g_int_hash
,
g_int_equal
);
iPhone
*
phone
=
get_iPhone
();
phone
=
get_iPhone
();
if
(
!
phone
){
if
(
!
phone
){
fprintf
(
stderr
,
"No iPhone found, is it connected?
\n
"
);
fprintf
(
stderr
,
"No iPhone found, is it connected?
\n
"
);
return
NULL
;
return
NULL
;
...
@@ -194,13 +196,10 @@ void *ifuse_init(struct fuse_conn_info *conn) {
...
@@ -194,13 +196,10 @@ void *ifuse_init(struct fuse_conn_info *conn) {
return
NULL
;
return
NULL
;
}
}
host_id
=
get_host_id
();
if
(
!
lockdownd_init
(
phone
,
&
control
))
{
if
((
host_id
&&
!
lockdownd_start_SSL_session
(
control
,
host_id
))
||
!
host_id
)
{
fprintf
(
stderr
,
"Something went wrong in the lockdownd client.
\n
"
);
fprintf
(
stderr
,
"Something went wrong in GnuTLS. Is your HostID configured in .config/libiphone/libiphonerc?
\n
"
);
return
NULL
;
return
NULL
;
}
}
free
(
host_id
);
host_id
=
NULL
;
port
=
lockdownd_start_service
(
control
,
"com.apple.afc"
);
port
=
lockdownd_start_service
(
control
,
"com.apple.afc"
);
if
(
!
port
)
{
if
(
!
port
)
{
...
@@ -215,11 +214,10 @@ void *ifuse_init(struct fuse_conn_info *conn) {
...
@@ -215,11 +214,10 @@ void *ifuse_init(struct fuse_conn_info *conn) {
void
ifuse_cleanup
(
void
*
data
)
{
void
ifuse_cleanup
(
void
*
data
)
{
AFClient
*
afc
=
(
AFClient
*
)
data
;
AFClient
*
afc
=
(
AFClient
*
)
data
;
if
(
afc
)
{
iPhone
*
phone
=
afc
->
connection
->
phone
;
afc_disconnect
(
afc
);
afc_disconnect
(
afc
);
lockdownd_close
(
control
);
free_iPhone
(
phone
);
free_iPhone
(
phone
);
}
}
}
int
ifuse_flush
(
const
char
*
path
,
struct
fuse_file_info
*
fi
)
{
int
ifuse_flush
(
const
char
*
path
,
struct
fuse_file_info
*
fi
)
{
...
...
src/lockdown.c
View file @
e5e5f21c
...
@@ -89,11 +89,12 @@ lockdownd_client *new_lockdownd_client(iPhone *phone) {
...
@@ -89,11 +89,12 @@ lockdownd_client *new_lockdownd_client(iPhone *phone) {
return
control
;
return
control
;
}
}
/** Closes the lockdownd client and does the necessary housekeeping.
/** Closes the lockdownd client and does the necessary housekeeping.
*
*
* @param control The lockdown client
* @param control The lockdown client
*/
*/
void
lockdown_close
(
lockdownd_client
*
control
)
{
void
lockdown
d
_close
(
lockdownd_client
*
control
)
{
if
(
!
control
)
return
;
if
(
!
control
)
return
;
if
(
control
->
connection
)
{
if
(
control
->
connection
)
{
mux_close_connection
(
control
->
connection
);
mux_close_connection
(
control
->
connection
);
...
...
src/main.c
View file @
e5e5f21c
...
@@ -131,6 +131,9 @@ int main(int argc, char *argv[]) {
...
@@ -131,6 +131,9 @@ int main(int argc, char *argv[]) {
printf
(
"Start service failure.
\n
"
);
printf
(
"Start service failure.
\n
"
);
}
}
printf
(
"All done.
\n
"
);
lockdownd_close
(
control
);
free_iPhone
(
phone
);
free_iPhone
(
phone
);
return
0
;
return
0
;
...
...
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