Skip to content

Commit

Permalink
dialog: release bin packet on prof replicate error
Browse files Browse the repository at this point in the history
If the profile cannot be replicated, release the bin packet to prevent
pkg memory leak.

(cherry picked from commit 4032ef0)
  • Loading branch information
razvancrainea committed Oct 22, 2018
1 parent 350c3d6 commit 533d0f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/dialog/dlg_replication.c
Expand Up @@ -982,8 +982,10 @@ int repl_prof_remove(str *name, str *value)
return -1;
}

if (repl_prof_add(&packet, name, value?1:0, value, 0) < 0)
if (repl_prof_add(&packet, name, value?1:0, value, 0) < 0) {
bin_free_packet(&packet);
return -1;
}
dlg_replicate_profiles(&packet);
bin_free_packet(&packet);

Expand Down

0 comments on commit 533d0f9

Please sign in to comment.