about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-07-26 09:50:06 -0400
committerJosh Rickmar <jrick@devio.us>2012-07-26 09:50:06 -0400
commit96b804727a44c46c5e9f43e195711ed9a45244e4 (patch)
treec07f2902655be84a4f4e5f88ab9ebdcd7a319f49 /xombrero.c
parentbf39530797cb32abc3f6de59e45d588f1822457f (diff)
downloadxombrero-96b804727a44c46c5e9f43e195711ed9a45244e4.tar.gz
Remove malloc calls
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c12
1 files changed, 5 insertions, 7 deletions
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);