Commit 5577af83 authored by Niels Möller's avatar Niels Möller
Browse files

Use NEW() macro.

Rev: src/service.c:1.5
Rev: src/unpad.c:1.12
Rev: src/zlib.c:1.8
parent ab036751
......@@ -81,7 +81,9 @@ static int do_service(struct packet_handler *c,
struct packet_handler *make_service_handler(struct alist *services)
{
struct service_handler *self = xalloc(sizeof(struct service_handler));
struct service_handler *self;
NEW(self);
self->super.handler = do_service;
self->services = services;
......
......@@ -24,8 +24,9 @@
*/
#include "unpad.h"
#include "xalloc.h"
#include "format.h"
#include "xalloc.h"
static int do_unpad(struct abstract_write **w,
struct lsh_string *packet)
......@@ -62,8 +63,9 @@ static int do_unpad(struct abstract_write **w,
struct abstract_write *
make_packet_unpad(struct abstract_write *continuation)
{
struct abstract_write_pipe *closure =
xalloc(sizeof(struct abstract_write_pipe));
struct abstract_write_pipe *closure;
NEW(closure);
closure->super.write = do_unpad;
closure->next = continuation;
......
......@@ -25,6 +25,8 @@
#include "zlib.h"
#error zlib.c not working at all
static int do_deflate(struct abstract_write **c,
struct lsh_string *packet)
{
......@@ -45,7 +47,8 @@ static int do_deflate(struct abstract_write **c,
struct abstract_write *make_packet_zlib(abstract_write *continuation,
int level)
{
struct debug_processor *closure = xalloc(sizeof(struct zlib_processor));
struct zlib_processor *closure;
NEW(closure);
closure->super.super.write = do_deflate;
closure->c->next = continuation;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment