aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Premysl 'Anydot' Hruby <dfenze@gmail.com>2009-05-02 23:10:46 +0200
committerGravatar Premysl 'Anydot' Hruby <dfenze@gmail.com>2009-05-02 23:10:46 +0200
commit0d882b5e8743bcdfd454336232a6c25d2a9cd624 (patch)
treec791c0164a85d635f8f8b207ec4ff3e8011f835d /uzbl.c
parent6880bcf32eb82b37f23379270c7edec3da3f0e52 (diff)
Fix memory leak, use g_strdup instead of estrdup
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/uzbl.c b/uzbl.c
index ca4f733..a805ba3 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -122,28 +122,13 @@ static gint max_conns;
static gint max_conns_host;
/* --- UTILITY FUNCTIONS --- */
-void
-eprint(const char *errstr, ...) {
- va_list ap;
- vfprintf(stderr, errstr, ap);
- va_end(ap);
- exit(EXIT_FAILURE);
-}
-
-char *
-estrdup(const char *str) {
- void *res = strdup(str);
- if(!res)
- eprint("fatal: could not allocate %u bytes\n", strlen(str));
- return res;
-}
char *
itos(int val) {
char tmp[20];
snprintf(tmp, sizeof(tmp), "%i", val);
- return estrdup(tmp);
+ return g_strdup(tmp);
}
/* --- CALLBACKS --- */
@@ -487,6 +472,7 @@ build_stream_name(int type) {
default:
break;
}
+ g_free(xwin_str);
}
static void
@@ -548,7 +534,7 @@ control_socket(GIOChannel *chan) {
buffer[strlen (buffer)] = '\0';
}
close (clientsock);
- ctl_line = estrdup(buffer);
+ ctl_line = g_strdup(buffer);
parse_line (ctl_line);
/*