Fix a non-critical memory leak.
PR: 12769 Submitted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
This commit is contained in:
parent
09590dc4c1
commit
6be40c9535
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49018
@ -45,7 +45,7 @@ static const char copyright[] =
|
|||||||
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93";
|
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93";
|
||||||
#endif
|
#endif
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id: init.c,v 1.32 1999/06/16 20:01:19 ru Exp $";
|
"$Id: init.c,v 1.33 1999/06/18 09:08:09 ru Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -935,8 +935,10 @@ construct_argv(command)
|
|||||||
register char **argv = (char **) malloc(((strlen(command) + 1) / 2 + 1)
|
register char **argv = (char **) malloc(((strlen(command) + 1) / 2 + 1)
|
||||||
* sizeof (char *));
|
* sizeof (char *));
|
||||||
|
|
||||||
if ((argv[argc++] = strk(command)) == 0)
|
if ((argv[argc++] = strk(command)) == 0) {
|
||||||
return 0;
|
free(argv);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
while ((argv[argc++] = strk((char *) 0)) != NULL)
|
while ((argv[argc++] = strk((char *) 0)) != NULL)
|
||||||
continue;
|
continue;
|
||||||
return argv;
|
return argv;
|
||||||
@ -1044,7 +1046,7 @@ setupargv(sp, typ)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
if (sp->se_window) {
|
if (sp->se_window) {
|
||||||
free(sp->se_window);
|
free(sp->se_window);
|
||||||
free(sp->se_window_argv_space);
|
free(sp->se_window_argv_space);
|
||||||
free(sp->se_window_argv);
|
free(sp->se_window_argv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user