]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Swap out Log+PANIC for Panic
authorJohn Wolfe <jwolfe@vmware.com>
Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Fri, 11 Sep 2020 19:11:03 +0000 (12:11 -0700)
Just call Panic with an appropriate string instead of a Log+PANIC.

open-vm-tools/lib/unicode/unicodeCommon.c

index 10dcb73b0a7126de76f128793e9c59fe04869a7b..0102af77abbf95334f248b167ef7159b71071bab 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2007-2016 VMware, Inc. All rights reserved.
+ * Copyright (C) 2007-2016,2020 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -331,16 +331,10 @@ Unicode_AllocWithLength(const void *buffer,       // IN:
       char *escapedBuffer = Unicode_EscapeBuffer(buffer, lengthInBytes,
                                                  encoding);
 
-      /*
-       * Log and panic on failure.
-       */
-
-      Log("%s: Couldn't convert invalid buffer [%s] from %s to Unicode.\n",
-          __FUNCTION__,
-          escapedBuffer ? escapedBuffer : "(couldn't escape bytes)",
-          Unicode_EncodingEnumToName(encoding));
-      free(escapedBuffer);
-      PANIC();
+      Panic("%s: Couldn't convert invalid buffer [%s] from %s to Unicode.\n",
+            __FUNCTION__,
+            escapedBuffer ? escapedBuffer : "(couldn't escape bytes)",
+            Unicode_EncodingEnumToName(encoding));
    }
 
    return result;