]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix potential memory leak, and use of uninitialized memory.
authorRussell Bryant <russell@russellbryant.com>
Thu, 5 May 2011 21:58:45 +0000 (21:58 +0000)
committerRussell Bryant <russell@russellbryant.com>
Thu, 5 May 2011 21:58:45 +0000 (21:58 +0000)
(closes issue #16476)
Reported by: junky
Patches:
      M16476.diff uploaded by junky (license 177)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317427 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_rpt.c

index a4d350d32eb3286977055e104d3499578048b421..1f150046ab89a830617e69da13e3ff070aa39188 100644 (file)
@@ -1963,7 +1963,11 @@ unsigned int seq;
                return;
        }
        n = finddelim(astr,astrs,100);
-       if (n < 1) return;
+       if (n < 1) {
+               ast_free(str);
+               ast_free(astr);
+               return;
+       }
        ast_mutex_lock(&myrpt->statpost_lock);
        seq = ++myrpt->statpost_seqno;
        ast_mutex_unlock(&myrpt->statpost_lock);
@@ -12188,7 +12192,7 @@ char tmpstr[300],lstr[MAXLINKLIST];
                                                // ctcss code autopatch initiate
                                                if (strstr((char *)f->data.ptr,"/M/")&& !myrpt->macropatch)
                                                {
-                                                   char value[16];
+                                                       char value[16] = "";
                                                        strcat(value,"*6");
                                                        myrpt->macropatch=1;
                                                        rpt_mutex_lock(&myrpt->lock);