[ros-diffs] [pschweitzer] 54032: [MAN] Fix memory leaks
pschweitzer at svn.reactos.org
pschweitzer at svn.reactos.org
Thu Oct 6 20:35:52 UTC 2011
Author: pschweitzer
Date: Thu Oct 6 20:35:52 2011
New Revision: 54032
URL: http://svn.reactos.org/svn/reactos?rev=54032&view=rev
Log:
[MAN]
Fix memory leaks
Modified:
trunk/rosapps/applications/sysutils/man/man.c
Modified: trunk/rosapps/applications/sysutils/man/man.c
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/sysutils/man/man.c?rev=54032&r1=54031&r2=54032&view=diff
==============================================================================
--- trunk/rosapps/applications/sysutils/man/man.c [iso-8859-1] (original)
+++ trunk/rosapps/applications/sysutils/man/man.c [iso-8859-1] Thu Oct 6 20:35:52 2011
@@ -62,8 +62,8 @@
else
retval=-1;
- strcpy(manpath_local, manpath);
- return retval;
+ free(manpath_local);
+ return retval;
}
int
@@ -142,14 +142,12 @@
void text_outp(char *cur_string)
{
- char TagFlag=0;
int symbol=0;
if(cur_string[0]=='.')
while(cur_string[symbol]!=' ')
symbol++;
- if(symbol) TagFlag=1;
for(;cur_string[symbol]!='\n'; symbol++)
putchar(cur_string[symbol]);
@@ -212,6 +210,9 @@
else text_outp(cur_string); // print plane text
th_outp(cur_string, THtag);
/* END of TAGs processing */
+ free(cur_string);
+ free(THtag);
+
return 0;
}
More information about the Ros-diffs
mailing list