Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
b2fc7ef0
Commit
b2fc7ef0
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
small memory leak fix, style change
parent
454979e8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libmobile.c
+4
-17
4 additions, 17 deletions
libmobile.c
libmobile.h
+16
-0
16 additions, 0 deletions
libmobile.h
with
20 additions
and
17 deletions
libmobile.c
+
4
−
17
View file @
b2fc7ef0
...
...
@@ -170,10 +170,9 @@ char *lexer(char **input, char *delimiter) {
if
(
token
)
*
token
=
'\0'
;
else
{
printf
(
"delimiter missing!
\n
"
);
else
return
NULL
;
}
char
*
substr
=
strdup
(
*
input
);
*
input
=
token
+
strlen
(
delimiter
);
...
...
@@ -181,19 +180,6 @@ char *lexer(char **input, char *delimiter) {
return
substr
;
}
/**
* Function: parse_apn_profiles
*
* Takes a string of APN profile configurations provided by zte-mf823 (which is in an awkward, difficult to read format)
* and transforms them into a more easily read and worked with JSON format.
*
* Parameters:
* apn_profiles - A character string containing the APN profiles.
*
* Returns:
* The newly generated JSON on success.
* NULL on failure.
*/
struct
json_object
*
parse_apn_profiles
(
char
*
apn_profiles
)
{
if
(
strlen
(
apn_profiles
)
<=
0
)
{
...
...
@@ -227,7 +213,8 @@ struct json_object *parse_apn_profiles(char *apn_profiles)
}
char
name
[
1024
];
sprintf
(
name
,
"%d"
,
apn_counter
);
json_object_object_add
(
parsed_profiles
,
name
,
apn_profile
);
//be careful here, do we need json_object_get(apn_profile)?
json_object_object_add
(
parsed_profiles
,
name
,
json_object_get
(
apn_profile
));
json_object_put
(
apn_profile
);
apn_counter
++
;
}
goto
finished
;
...
...
This diff is collapsed.
Click to expand it.
libmobile.h
+
16
−
0
View file @
b2fc7ef0
...
...
@@ -40,7 +40,23 @@
* the caller is then responsible for freeing this memory by calling free(returned_pointer).
*
***************************************************/
/**
* __TEMPORARILY PLACED IN THIS HEAD__
* Function: parse_apn_profiles
*
* Takes a string of APN profile configurations provided by zte-mf823 (which is in an awkward, difficult to read format)
* and transforms them into a more easily read and worked with JSON format.
*
* Parameters:
* apn_profiles - A character string containing the APN profiles.
*
* Returns:
* The newly generated JSON on success.
* NULL on failure.
*/
struct
json_object
*
parse_apn_profiles
(
char
*
apn_profiles
);
/**
* Function: mobile_connect_network
*
...
...
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