summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2008-04-15 18:22:08 +0000
committerokan <okan>2008-04-15 18:22:08 +0000
commitfe80d400634a3b5e38ad8d1e9b5a3146306305d2 (patch)
treea80169fb71ab2170983910664f808f095ebaaa2f
parent343ec1bb4fa42eabd35222b4dc1bd53fc7690026 (diff)
downloadcwm-fe80d400634a3b5e38ad8d1e9b5a3146306305d2.tar.gz
cwm-fe80d400634a3b5e38ad8d1e9b5a3146306305d2.tar.xz
cwm-fe80d400634a3b5e38ad8d1e9b5a3146306305d2.zip
malloc -> calloc
suggested by and ok oga@
-rw-r--r--calmwm.c1
-rw-r--r--parse.y3
2 files changed, 2 insertions, 2 deletions
diff --git a/calmwm.c b/calmwm.c
index 9821b58..bfba638 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -81,6 +81,7 @@ main(int argc, char **argv)
 	group_init();
 
 	Starting = 1;
+	bzero(&Conf, sizeof(Conf));
 	conf_setup(&Conf, conffile);
 	client_setup();
 	x_setup(display_name);
diff --git a/parse.y b/parse.y
index bb5e44c..7322bbe 100644
--- a/parse.y
+++ b/parse.y
@@ -513,8 +513,7 @@ parse_config(const char *filename, struct conf *xconf)
 {
 	int			 errors = 0;
 
-	if ((conf = malloc(sizeof(struct conf))) == NULL)
-		return (-1);
+	XCALLOC(conf, struct conf);
 
 	if ((file = pushfile(filename)) == NULL) {
 		free(conf);