Bug 329740 - Remove JSXDR_FREE, r=igor
authorMichael Wu <mwu@mozilla.com>
Tue, 08 Mar 2011 08:59:01 -0800
changeset 64244 ff5bb67330c01198a0d0035d59d1d18ad2fb449c
parent 64243 441bc12e94e24d8d882cc32b9bd2479f83224179
child 64245 64ccb8c2892a0dc6ef92184876672cb671b9e5e4
push idunknown
push userunknown
push dateunknown
reviewersigor
bugs329740
milestone2.0b13pre
Bug 329740 - Remove JSXDR_FREE, r=igor
js/src/jsxdrapi.cpp
js/src/jsxdrapi.h
--- a/js/src/jsxdrapi.cpp
+++ b/js/src/jsxdrapi.cpp
@@ -391,19 +391,16 @@ JS_XDRCString(JSXDRState *xdr, char **sp
     }
     if (!JS_XDRBytes(xdr, *sp, len)) {
         if (xdr->mode == JSXDR_DECODE)
             xdr->cx->free(*sp);
         return JS_FALSE;
     }
     if (xdr->mode == JSXDR_DECODE) {
         (*sp)[len] = '\0';
-    } else if (xdr->mode == JSXDR_FREE) {
-        xdr->cx->free(*sp);
-        *sp = NULL;
     }
     return JS_TRUE;
 }
 
 JS_PUBLIC_API(JSBool)
 JS_XDRCStringOrNull(JSXDRState *xdr, char **sp)
 {
     uint32 null = (*sp == NULL);
--- a/js/src/jsxdrapi.h
+++ b/js/src/jsxdrapi.h
@@ -80,18 +80,17 @@ JS_BEGIN_EXTERN_C
 #else
 #error "unknown byte order"
 #endif
 
 #define JSXDR_ALIGN     4
 
 typedef enum JSXDRMode {
     JSXDR_ENCODE,
-    JSXDR_DECODE,
-    JSXDR_FREE
+    JSXDR_DECODE
 } JSXDRMode;
 
 typedef enum JSXDRWhence {
     JSXDR_SEEK_SET,
     JSXDR_SEEK_CUR,
     JSXDR_SEEK_END
 } JSXDRWhence;