encoding-profile: Don't use preset_name string after free
authorSebastian Dröge <sebastian@centricular.com>
Tue, 29 Dec 2015 15:54:44 +0000 (17:54 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 29 Dec 2015 15:55:23 +0000 (17:55 +0200)
commitf31240a765b3220b8e1ee736ff3f6c41fea35a26
treed3943d5f16a729ec8a6928b5dc0237709ee0b001
parent898940a37ffcafb69b61cc0ce02f6be24e7e2280
encoding-profile: Don't use preset_name string after free

When we run the loop for another time and do not have a preset name, we would
try to print the preset name of a previous iteration that is already freed.

Also move some other variables into the block where they are actually used
to prevent similar mistakes in the future.

CID 1346536
gst-libs/gst/pbutils/encoding-profile.c