Fixing memory leak in python support function
[ric-plt/lib/rmr.git] / src / rmr / common / src / wrapper.c
index 9d3dd72..63f5d8a 100644 (file)
@@ -84,8 +84,16 @@ static int bang_on( char* target, char* src, int max ) {
        return rc;
 }
 
+/*
+       Frees the string that was allocated and returned using rmr_get_consts()
+*/
+extern void rmr_free_consts( char* p) {
+       free(p);
+}
+
 /*
        Returns a set of json with the constants which are set in the header.
+       Caller must free the returned string using rmr_free_consts()
 */
 extern char* rmr_get_consts( ) {
        int             remain;                         // bytes remaining in wbuf