OSDN Git Service

Replace variable-length arrays on stack with malloc. am: 943905bb9f am: 837c8b680a...
authorAmit Mahajan <amitmahajan@google.com>
Tue, 16 Aug 2016 23:17:13 +0000 (23:17 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Tue, 16 Aug 2016 23:17:13 +0000 (23:17 +0000)
am: 3f56be6062

Change-Id: I9d2d4f4fb1039fe505c9c2e76b9a57a8801242c3

1  2 
libril/RilSapSocket.cpp

@@@ -364,12 -368,13 +369,13 @@@ void RilSapSocket::sendResponse(MsgHead
                  RLOGD("Write successful");
              }
          } else {
 -            RLOGE("Error while encoding response of type %d id %d buffer_size: %d: %s.",
 -            hdr->type, hdr->id, buffer_size, PB_GET_ERROR(&ostream));
 +            RLOGE("Error while encoding response of type %d id %d buffer_size: %zu: %s.",
 +                    hdr->type, hdr->id, buffer_size, PB_GET_ERROR(&ostream));
          }
+         free(buffer);
      } else {
 -    RLOGE("Not sending response type %d: encoded_size: %u. commandFd: %d. encoded size result: %d",
 -        hdr->type, encoded_size, commandFd, success);
 +        RLOGE("Not sending response type %d: encoded_size: %zu. commandFd: %d. encoded size result:\
 +                %d", hdr->type, encoded_size, commandFd, success);
      }
  
      pthread_mutex_unlock(&write_lock);