1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

* fix a few little dissonances

This commit is contained in:
Tim Ruehsen 2012-06-04 12:25:30 +02:00 committed by Giuseppe Scrivano
parent 6741bc4233
commit 321b5dce85
5 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2012-06-04 Tim Ruehsen <tim.ruehsen@gmx.de>
* main.c (main): Check for filename != NULL.
* warc.c (warc_process_cdx_line): Fix memory leak.
* utils.c (match_posix_regex, compile_posix_regex): Remove dead
assignment.
* openssl.c (ssl_init): Fix old-style function definition.
2012-06-02 Giuseppe Scrivano <gscrivano@gnu.org>
* connect.c: Include <sys/socket.h> and <sys/select.h>.

View File

@ -1566,7 +1566,7 @@ outputting to a regular file.\n"));
&dt, opt.recursive, iri, true);
}
if (opt.delete_after && file_exists_p(filename))
if (opt.delete_after && filename != NULL && file_exists_p (filename))
{
DEBUGP (("Removing file due to --delete-after in main():\n"));
logprintf (LOG_VERBOSE, _("Removing %s.\n"), filename);

View File

@ -159,7 +159,7 @@ key_type_to_ssl_type (enum keyfile_type type)
Returns true on success, false otherwise. */
bool
ssl_init ()
ssl_init (void)
{
SSL_METHOD const *meth;

View File

@ -2355,7 +2355,7 @@ compile_posix_regex (const char *str)
{
int errbuf_size = regerror (errcode, (regex_t *) regex, NULL, 0);
char *errbuf = xmalloc (errbuf_size);
errbuf_size = regerror (errcode, (regex_t *) regex, errbuf, errbuf_size);
regerror (errcode, (regex_t *) regex, errbuf, errbuf_size);
fprintf (stderr, _("Invalid regular expression %s, %s\n"),
quote (str), errbuf);
xfree (errbuf);
@ -2402,7 +2402,7 @@ match_posix_regex (const void *regex, const char *str)
{
int errbuf_size = regerror (rc, opt.acceptregex, NULL, 0);
char *errbuf = xmalloc (errbuf_size);
errbuf_size = regerror (rc, opt.acceptregex, errbuf, errbuf_size);
regerror (rc, opt.acceptregex, errbuf, errbuf_size);
logprintf (LOG_VERBOSE, _("Error while matching %s: %d\n"),
quote (str), rc);
xfree (errbuf);

View File

@ -913,6 +913,12 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url,
free (record_id);
}
}
else
{
xfree_null(checksum);
xfree_null(original_url);
xfree_null(record_id);
}
}
/* Loads the CDX file from opt.warc_cdx_dedup_filename and fills