Skip to content

Commit

Permalink
Update rbus_subscriptions.c
Browse files Browse the repository at this point in the history
  • Loading branch information
NetajiPanigrahi authored Nov 18, 2024
1 parent 3e23650 commit 50886df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rbus/rbus_subscriptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ static void rbusSubscriptions_loadCache(rbusSubscriptions_t subscriptions)
rbusBuffer_Destroy(buff);

if(sub)
free(sub);
subscriptionFree(sub);

if(remove(filePath) != 0)
RBUSLOG_ERROR("failed to remove %s", filePath);
Expand Down Expand Up @@ -665,7 +665,11 @@ static void rbusSubscriptions_saveCache(rbusSubscriptions_t subscriptions)
{
rtListItem_GetData(item, (void**)&sub);
if(!sub)
{
rbusBuffer_Destroy(buff);
fclose(file);
return;
}
rbusBuffer_WriteStringTLV(buff, sub->listener, strlen(sub->listener)+1);
rbusBuffer_WriteStringTLV(buff, sub->eventName, strlen(sub->eventName)+1);
rbusBuffer_WriteInt32TLV(buff, sub->componentId);
Expand Down

0 comments on commit 50886df

Please sign in to comment.