Jisi Liu 8 жил өмнө
parent
commit
b4c0cfe3a4

+ 2 - 2
src/google/protobuf/compiler/subprocess.cc

@@ -54,8 +54,8 @@ namespace compiler {
 
 namespace {
 char* portable_strdup(const char* s) {
-  char* ns = malloc(strlen(s) + 1);
-  if (ns) {
+  char* ns = (char*) malloc(strlen(s) + 1);
+  if (ns != NULL) {
     strcpy(ns, s);
   }
   return ns;