summaryrefslogtreecommitdiff
path: root/libdaemon
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2018-06-08 13:40:53 +0100
committerJoe Thornber <ejt@redhat.com>2018-06-08 13:40:53 +0100
commitd5da55ed85248adb066d293c2a1b863ce17d2779 (patch)
treee526dd2f773e3016a3acd3cb8e490ed11ba7c439 /libdaemon
parentc78239d8605f333915543c0e0c3ccf4f4ef5ee8f (diff)
downloadlvm2-d5da55ed85248adb066d293c2a1b863ce17d2779.tar.gz
device_mapper: remove dbg_malloc.
I wrote dbg_malloc before we had valgrind. These days there's just no need.
Diffstat (limited to 'libdaemon')
-rw-r--r--libdaemon/client/config-util.c10
-rw-r--r--libdaemon/client/daemon-client.c6
-rw-r--r--libdaemon/server/daemon-log.c12
-rw-r--r--libdaemon/server/daemon-server.c4
4 files changed, 16 insertions, 16 deletions
diff --git a/libdaemon/client/config-util.c b/libdaemon/client/config-util.c
index f8526d75c..bdbdd3ae4 100644
--- a/libdaemon/client/config-util.c
+++ b/libdaemon/client/config-util.c
@@ -63,12 +63,12 @@ int buffer_append_vf(struct buffer *buf, va_list ap)
!buffer_append(buf, append))
goto fail;
- dm_free(append);
+ free(append);
}
return 1;
fail:
- dm_free(append);
+ free(append);
return 0;
}
@@ -365,11 +365,11 @@ int buffer_realloc(struct buffer *buf, int needed)
alloc = needed;
buf->allocated += alloc;
- new = dm_realloc(buf->mem, buf->allocated);
+ new = realloc(buf->mem, buf->allocated);
if (new)
buf->mem = new;
else { /* utter failure */
- dm_free(buf->mem);
+ free(buf->mem);
buf->mem = 0;
buf->allocated = buf->used = 0;
return 0;
@@ -402,7 +402,7 @@ int buffer_line(const char *line, void *baton)
void buffer_destroy(struct buffer *buf)
{
- dm_free(buf->mem);
+ free(buf->mem);
buffer_init(buf);
}
diff --git a/libdaemon/client/daemon-client.c b/libdaemon/client/daemon-client.c
index 28d7c04a3..53f449556 100644
--- a/libdaemon/client/daemon-client.c
+++ b/libdaemon/client/daemon-client.c
@@ -60,7 +60,7 @@ daemon_handle daemon_open(daemon_info i)
/* Check protocol and version matches */
h.protocol = daemon_reply_str(r, "protocol", NULL);
if (h.protocol)
- h.protocol = dm_strdup(h.protocol); /* keep around */
+ h.protocol = strdup(h.protocol); /* keep around */
h.protocol_version = daemon_reply_int(r, "version", 0);
if (i.protocol && (!h.protocol || strcmp(h.protocol, i.protocol))) {
@@ -85,7 +85,7 @@ error:
if (r.cft)
daemon_reply_destroy(r);
- dm_free((char *)h.protocol);
+ free((char *)h.protocol);
h.protocol = NULL;
return h;
@@ -181,7 +181,7 @@ void daemon_close(daemon_handle h)
log_sys_error("close", "daemon_close");
}
- dm_free((char *)h.protocol);
+ free((char *)h.protocol);
}
daemon_request daemon_request_make(const char *id)
diff --git a/libdaemon/server/daemon-log.c b/libdaemon/server/daemon-log.c
index 8c2a20821..864f504f6 100644
--- a/libdaemon/server/daemon-log.c
+++ b/libdaemon/server/daemon-log.c
@@ -91,7 +91,7 @@ void daemon_logf(log_state *s, int type, const char *fmt, ...) {
va_start(ap, fmt);
if (dm_vasprintf(&buf, fmt, ap) >= 0) {
daemon_log(s, type, buf);
- dm_free(buf);
+ free(buf);
} /* else return_0 */
va_end(ap);
}
@@ -127,7 +127,7 @@ void daemon_log_multi(log_state *s, int type, const char *prefix, const char *ms
if (!_type_interesting(s, type))
return;
- buf = dm_strdup(msg);
+ buf = strdup(msg);
pos = buf;
if (!buf)
@@ -140,7 +140,7 @@ void daemon_log_multi(log_state *s, int type, const char *prefix, const char *ms
_log_line(pos, &b);
pos = next ? next + 1 : 0;
}
- dm_free(buf);
+ free(buf);
}
void daemon_log_enable(log_state *s, int outlet, int type, int enable)
@@ -184,7 +184,7 @@ int daemon_log_parse(log_state *s, int outlet, const char *types, int enable)
if (!types || !types[0])
return 1;
- if (!(buf = dm_strdup(types)))
+ if (!(buf = strdup(types)))
return 0;
pos = buf;
@@ -193,13 +193,13 @@ int daemon_log_parse(log_state *s, int outlet, const char *types, int enable)
if (next)
*next = 0;
if (!_parse_one(s, outlet, pos, enable)) {
- dm_free(buf);
+ free(buf);
return 0;
}
pos = next ? next + 1 : 0;
}
- dm_free(buf);
+ free(buf);
return 1;
}
diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c
index 4acb00e0b..78c8221e2 100644
--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -515,7 +515,7 @@ static int _handle_connect(daemon_state s)
if (fcntl(client.socket_fd, F_SETFD, FD_CLOEXEC))
WARN(&s, "setting CLOEXEC on client socket fd %d failed", client.socket_fd);
- if (!(ts = dm_malloc(sizeof(thread_state)))) {
+ if (!(ts = malloc(sizeof(thread_state)))) {
if (close(client.socket_fd))
perror("close");
ERROR(&s, "Failed to allocate thread state");
@@ -547,7 +547,7 @@ static void _reap(daemon_state s, int waiting)
if ((errno = pthread_join(ts->client.thread_id, &rv)))
ERROR(&s, "pthread_join failed: %s", strerror(errno));
last->next = ts->next;
- dm_free(ts);
+ free(ts);
} else
last = ts;
ts = last->next;