Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
2a90a68c
Commit
2a90a68c
authored
Jun 23, 2011
by
Moritz Lipp
Browse files
Saner solution for the possible seg fault
parent
9d5cbcab
Changes
1
Hide whitespace changes
Inline
Side-by-side
zathura.c
View file @
2a90a68c
...
...
@@ -25,20 +25,6 @@ gboolean document_info_open(gpointer data);
zathura_t
*
zathura_init
(
int
argc
,
char
*
argv
[])
{
zathura_t
*
zathura
=
malloc
(
sizeof
(
zathura_t
));
if
(
zathura
==
NULL
)
{
return
NULL
;
}
/* general */
zathura
->
document
=
NULL
;
/* plugins */
zathura
->
plugins
.
plugins
=
girara_list_new
();
zathura
->
plugins
.
path
=
girara_list_new
();
girara_list_set_free_function
(
zathura
->
plugins
.
path
,
g_free
);
/* parse command line options */
GdkNativeWindow
embed
=
0
;
gchar
*
config_dir
=
NULL
,
*
data_dir
=
NULL
,
*
plugin_path
=
NULL
;
...
...
@@ -60,11 +46,24 @@ zathura_init(int argc, char* argv[])
printf
(
"Error parsing command line arguments: %s
\n
"
,
error
->
message
);
g_option_context_free
(
context
);
g_error_free
(
error
);
free
(
zathura
);
return
NULL
;
goto
error_free
;
}
g_option_context_free
(
context
);
zathura_t
*
zathura
=
malloc
(
sizeof
(
zathura_t
));
if
(
zathura
==
NULL
)
{
return
NULL
;
}
/* general */
zathura
->
document
=
NULL
;
/* plugins */
zathura
->
plugins
.
plugins
=
girara_list_new
();
zathura
->
plugins
.
path
=
girara_list_new
();
girara_list_set_free_function
(
zathura
->
plugins
.
path
,
g_free
);
if
(
config_dir
)
{
zathura
->
config
.
config_dir
=
g_strdup
(
config_dir
);
}
else
{
...
...
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