Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
81df3b51
...
81df3b518fbf75717b4013126e200ee0c256e244
authored
2006-05-20 10:43:25 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_file_to_message): Fix a memory leak
1 parent
7125b13c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
mh/mh_init.c
mh/mh_init.c
View file @
81df3b5
...
...
@@ -638,16 +638,13 @@ mh_file_copy (const char *from, const char *to)
return
rc
;
}
mu_message_t
mh_file_to_message
(
const
char
*
folder
,
char
*
file_name
)
static
mu_message_t
_file_to_message
(
char
*
file_name
)
{
struct
stat
st
;
int
rc
;
mu_stream_t
instream
;
if
(
folder
)
file_name
=
mh_expand_name
(
folder
,
file_name
,
0
);
if
(
stat
(
file_name
,
&
st
)
<
0
)
{
mu_error
(
_
(
"Cannot stat file %s: %s"
),
file_name
,
strerror
(
errno
));
...
...
@@ -672,6 +669,24 @@ mh_file_to_message (const char *folder, char *file_name)
return
mh_stream_to_message
(
instream
);
}
mu_message_t
mh_file_to_message
(
const
char
*
folder
,
char
*
file_name
)
{
mu_message_t
msg
;
char
*
tmp_name
=
NULL
;
if
(
folder
)
{
tmp_name
=
mh_expand_name
(
folder
,
file_name
,
0
);
msg
=
_file_to_message
(
tmp_name
);
free
(
tmp_name
);
}
else
msg
=
_file_to_message
(
file_name
);
return
msg
;
}
void
mh_install_help
(
char
*
mhdir
)
{
...
...
Please
register
or
sign in
to post a comment