struct io_pkt io;
Dmsg1(dbglvl, "plugin_bopen flags=%x\n", flags);
+ if (!plugin || !jcr->plugin_ctx) {
+ return 0;
+ }
io.pkt_size = sizeof(io);
io.pkt_end = sizeof(io);
io.func = IO_OPEN;
JCR *jcr = bfd->jcr;
Plugin *plugin = (Plugin *)jcr->plugin;
struct io_pkt io;
+
Dmsg0(dbglvl, "===== plugin_bclose\n");
+ if (!plugin || !jcr->plugin_ctx) {
+ return 0;
+ }
io.pkt_size = sizeof(io);
io.pkt_end = sizeof(io);
io.func = IO_CLOSE;
JCR *jcr = bfd->jcr;
Plugin *plugin = (Plugin *)jcr->plugin;
struct io_pkt io;
+
Dmsg0(dbglvl, "plugin_bread\n");
+ if (!plugin || !jcr->plugin_ctx) {
+ return 0;
+ }
io.pkt_size = sizeof(io);
io.pkt_end = sizeof(io);
io.func = IO_READ;
JCR *jcr = bfd->jcr;
Plugin *plugin = (Plugin *)jcr->plugin;
struct io_pkt io;
+
Dmsg0(dbglvl, "plugin_bwrite\n");
+ if (!plugin || !jcr->plugin_ctx) {
+ return 0;
+ }
io.pkt_size = sizeof(io);
io.pkt_end = sizeof(io);
io.func = IO_WRITE;
JCR *jcr = bfd->jcr;
Plugin *plugin = (Plugin *)jcr->plugin;
struct io_pkt io;
+
Dmsg0(dbglvl, "plugin_bseek\n");
+ if (!plugin || !jcr->plugin_ctx) {
+ return 0;
+ }
io.pkt_size = sizeof(io);
io.pkt_end = sizeof(io);
io.func = IO_SEEK;
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2003-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2003-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
*
* Kern Sibbald, April MMIII
*
- * Version $Id$
- *
*/
#include "bacula.h"
{
int stat = 0;
- if (bfd->errmsg) {
- free_pool_memory(bfd->errmsg);
- bfd->errmsg = NULL;
- }
if (bfd->mode == BF_CLOSED) {
Dmsg0(50, "=== BFD already closed.\n");
return 0;
}
all_done:
+ if (bfd->errmsg) {
+ free_pool_memory(bfd->errmsg);
+ bfd->errmsg = NULL;
+ }
bfd->mode = BF_CLOSED;
bfd->lpContext = NULL;
bfd->cmd_plugin = false;
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
static bRC freePlugin(bpContext *ctx)
{
struct plugin_ctx *p_ctx = (struct plugin_ctx *)ctx->pContext;
+ if (!p_ctx) {
+ return bRC_Error;
+ }
if (p_ctx->cmd) {
free(p_ctx->cmd); /* free any allocated command string */
}
static bRC handlePluginEvent(bpContext *ctx, bEvent *event, void *value)
{
struct plugin_ctx *p_ctx = (struct plugin_ctx *)ctx->pContext;
+ if (!p_ctx) {
+ return bRC_Error;
+ }
+
// char *name;
/*
static bRC startBackupFile(bpContext *ctx, struct save_pkt *sp)
{
struct plugin_ctx *p_ctx = (struct plugin_ctx *)ctx->pContext;
+ if (!p_ctx) {
+ return bRC_Error;
+ }
time_t now = time(NULL);
sp->fname = p_ctx->fname;
sp->type = FT_REG;
static bRC pluginIO(bpContext *ctx, struct io_pkt *io)
{
struct plugin_ctx *p_ctx = (struct plugin_ctx *)ctx->pContext;
+ if (!p_ctx) {
+ return bRC_Error;
+ }
io->status = 0;
io->io_errno = 0;