about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--about.c3
-rw-r--r--xombrero.c12
2 files changed, 7 insertions, 8 deletions
diff --git a/about.c b/about.c
index b00e1d7..53caf84 100644
--- a/about.c
+++ b/about.c
@@ -1842,7 +1842,8 @@ xtp_page_sv(struct tab *t, struct karg *args)
 	if (t == NULL)
 		show_oops(NULL, "secviolation invalid parameters");
 
-	/* Generate a new session key for next page instance.
+	/*
+	 * Generate a new session key for next page instance.
 	 * This only happens for the top level call to xtp_page_ab()
 	 * in which case updating_sv_tabs = 0.
 	 */
diff --git a/xombrero.c b/xombrero.c
index f40d65c..867ccf9 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -782,10 +782,11 @@ char *
 guess_url_type(char *url_in)
 {
 	struct stat		sb;
+	char			cwd[PATH_MAX] = {0};
 	char			*url_out = NULL, *enc_search = NULL;
+	char			*path = NULL;
+	char			**sv = NULL;
 	int			i;
-	char			*cwd, *path = NULL;
-	char			**sv;
 
 
 	/* substitute aliases */
@@ -821,13 +822,11 @@ guess_url_type(char *url_in)
 		if (url_in[0] == '/')
 			url_out = g_filename_to_uri(url_in, NULL, NULL);
 		else {
-			cwd = malloc(PATH_MAX);
 			if (getcwd(cwd, PATH_MAX) != NULL) {
 				path = g_strdup_printf("%s" PS "%s", cwd,
 				    url_in);
 				url_out = g_filename_to_uri(path, NULL, NULL);
 			}
-			free(cwd);
 			if (path)
 				free(path);
 		}
@@ -2069,7 +2068,7 @@ warn_cert_cache_differs_idle(struct karg *args)
 		return (0);
 	}
 	xtp_page_sv((struct tab *)args->ptr, args);
-	free(args);
+	g_free(args);
 	return (0);
 }
 
@@ -2103,8 +2102,7 @@ check_cert_changes(struct tab *t, const char *uri)
 		if (RB_FIND(sv_ignore_list, &svil, &find))
 			break;
 		t->xtp_meaning = XT_XTP_TAB_MEANING_SV;
-		argsp = malloc(sizeof(struct karg));
-		bzero(argsp, sizeof(struct karg));
+		argsp = g_malloc0(sizeof(struct karg));
 		argsp->s = g_strdup((char *)uri);
 		argsp->ptr = (void *)t;
 		g_idle_add((GSourceFunc)warn_cert_cache_differs_idle, argsp);