Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
api_idnode_handler: do not call idnode_perm_unset for destroyed idnod…
…e (clang sanitizer)
  • Loading branch information
perexg committed Mar 10, 2016
1 parent b5df696 commit 75d640c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/api.h
Expand Up @@ -115,7 +115,7 @@ int api_idnode_load_by_class

int api_idnode_handler
( access_t *perm, htsmsg_t *args, htsmsg_t **resp,
void (*handler)(access_t *perm, idnode_t *in), const char *op );
void (*handler)(access_t *perm, idnode_t *in), const char *op, int destroyed );

int api_idnode_load_simple
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp );
Expand Down
14 changes: 7 additions & 7 deletions src/api/api_dvr.c
Expand Up @@ -266,7 +266,7 @@ static int
api_dvr_entry_rerecord_toggle
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_rerecord_toggle, "rerecord");
return api_idnode_handler(perm, args, resp, api_dvr_rerecord_toggle, "rerecord", 0);
}

static void
Expand All @@ -279,7 +279,7 @@ static int
api_dvr_entry_rerecord_deny
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_rerecord_deny, "rerecord");
return api_idnode_handler(perm, args, resp, api_dvr_rerecord_deny, "rerecord", 0);
}

static void
Expand All @@ -292,7 +292,7 @@ static int
api_dvr_entry_rerecord_allow
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_rerecord_allow, "rerecord");
return api_idnode_handler(perm, args, resp, api_dvr_rerecord_allow, "rerecord", 0);
}

static void
Expand All @@ -305,7 +305,7 @@ static int
api_dvr_entry_stop
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_stop, "stop");
return api_idnode_handler(perm, args, resp, api_dvr_stop, "stop", 0);
}

static void
Expand All @@ -318,7 +318,7 @@ static int
api_dvr_entry_cancel
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_cancel, "cancel");
return api_idnode_handler(perm, args, resp, api_dvr_cancel, "cancel", 0);
}

static void
Expand All @@ -331,7 +331,7 @@ static int
api_dvr_entry_move_finished
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_move_finished, "move finished");
return api_idnode_handler(perm, args, resp, api_dvr_move_finished, "move finished", 0);
}

static void
Expand All @@ -344,7 +344,7 @@ static int
api_dvr_entry_move_failed
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_dvr_move_failed, "move failed");
return api_idnode_handler(perm, args, resp, api_dvr_move_failed, "move failed", 0);
}

static void
Expand Down
11 changes: 6 additions & 5 deletions src/api/api_idnode.c
Expand Up @@ -613,7 +613,7 @@ int
api_idnode_handler
( access_t *perm, htsmsg_t *args, htsmsg_t **resp,
void (*handler)(access_t *perm, idnode_t *in),
const char *op )
const char *op, int destroyed )
{
int err = 0;
idnode_t *in;
Expand Down Expand Up @@ -645,7 +645,8 @@ api_idnode_handler
continue;
}
handler(perm, in);
idnode_perm_unset(in);
if (!destroyed)
idnode_perm_unset(in);
cnt++;
}
htsmsg_destroy(msg);
Expand Down Expand Up @@ -686,7 +687,7 @@ static int
api_idnode_delete
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_idnode_delete_, "delete");
return api_idnode_handler(perm, args, resp, api_idnode_delete_, "delete", 1);
}

static void
Expand All @@ -699,7 +700,7 @@ static int
api_idnode_moveup
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_idnode_moveup_, "moveup");
return api_idnode_handler(perm, args, resp, api_idnode_moveup_, "moveup", 0);
}

static void
Expand All @@ -712,7 +713,7 @@ static int
api_idnode_movedown
( access_t *perm, void *opaque, const char *op, htsmsg_t *args, htsmsg_t **resp )
{
return api_idnode_handler(perm, args, resp, api_idnode_movedown_, "movedown");
return api_idnode_handler(perm, args, resp, api_idnode_movedown_, "movedown", 0);
}

void api_idnode_init ( void )
Expand Down

0 comments on commit 75d640c

Please sign in to comment.