Mercurial > mplayer.hg
comparison stream/freesdp/parser.c @ 32537:8fa2f43cb760
Remove most of the NULL pointer check before free all over the code
author | cboesch |
---|---|
date | Sun, 14 Nov 2010 09:12:34 +0000 |
parents | 9e7e36fd3ba3 |
children | c6b4a486c108 |
comparison
equal
deleted
inserted
replaced
32536:187f26cba0ce | 32537:8fa2f43cb760 |
---|---|
469 dsc->a_controls_count++; | 469 dsc->a_controls_count++; |
470 } | 470 } |
471 } | 471 } |
472 else if (!strncmp (fsdp_buf[0], "range", 5)) | 472 else if (!strncmp (fsdp_buf[0], "range", 5)) |
473 { | 473 { |
474 if (dsc->a_range) | 474 free (dsc->a_range); |
475 free (dsc->a_range); | |
476 dsc->a_range = strdup (fsdp_buf[1]); | 475 dsc->a_range = strdup (fsdp_buf[1]); |
477 } | 476 } |
478 else | 477 else |
479 { | 478 { |
480 /* ignore unknown attributes, but provide access to them */ | 479 /* ignore unknown attributes, but provide access to them */ |
768 media->a_controls_count++; | 767 media->a_controls_count++; |
769 } | 768 } |
770 } | 769 } |
771 else if (!strncmp (fsdp_buf[0], "range", 5)) | 770 else if (!strncmp (fsdp_buf[0], "range", 5)) |
772 { | 771 { |
773 if (media->a_range) | 772 free (media->a_range); |
774 free (media->a_range); | |
775 media->a_range = strdup (fsdp_buf[1]); | 773 media->a_range = strdup (fsdp_buf[1]); |
776 } | 774 } |
777 else if (!strncmp (fsdp_buf[0], "framerate", 9)) | 775 else if (!strncmp (fsdp_buf[0], "framerate", 9)) |
778 media->a_framerate = strtod (longfsdp_buf, NULL); | 776 media->a_framerate = strtod (longfsdp_buf, NULL); |
779 else if (!strncmp (fsdp_buf[0], "fmtp", 4)) | 777 else if (!strncmp (fsdp_buf[0], "fmtp", 4)) |