Unverified Commit 9e7dd793 authored by Shawn Webb's avatar Shawn Webb
Browse files

Add functions to free objects



Introduce `pushover_free_ctx` and `pushover_free_message`.
Signed-off-by: Shawn Webb's avatarShawn Webb <shawn.webb@hardenedbsd.org>
parent d9b83dae
......@@ -57,6 +57,23 @@ out:
return (res);
}
EXPORTED_SYM
void
pushover_free_ctx(pushover_ctx_t **ctx)
{
pushover_ctx_t *ctxp;
if (ctx == NULL || *ctx == NULL)
return;
ctxp = *ctx;
free(ctxp->psh_uri);
free(ctxp->psh_token);
free(ctxp);
*ctx = NULL;
}
EXPORTED_SYM
bool
pushover_set_uri(pushover_ctx_t *ctx, const char *uri)
......
......@@ -34,6 +34,7 @@ typedef struct _pushover_message {
} pushover_message_t;
pushover_ctx_t *pushover_init_ctx(const char *);
void pushover_free_ctx(pushover_ctx_t **);
bool pushover_set_uri(pushover_ctx_t *, const char *);
bool pushover_set_token(pushover_ctx_t *, const char *);
pushover_message_t *pushover_init_message(pushover_message_t *);
......
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