Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed problem in setReferencePrefix().

  • Loading branch information...
commit eefd56dacdc9de9ffaf8e36f0e78476e5e19289a 1 parent b79182f
Gustavo Lopes authored
5 markdowndoc_class.c
View
@@ -132,6 +132,10 @@ static void free_object_storage(void *object TSRMLS_DC)
mkd_cleanup(dobj->markdoc);
dobj->markdoc = NULL;
}
+ if (dobj->ref_prefix != NULL) {
+ efree(dobj->ref_prefix);
+ dobj->ref_prefix = NULL;
+ }
markdowndoc_free_callback(&dobj->url_fci, &dobj->url_fcc);
markdowndoc_free_callback(&dobj->attr_fci, &dobj->attr_fcc);
@@ -160,6 +164,7 @@ static zend_object_value ce_create_object(zend_class_entry *class_type TSRMLS_DC
dobj->url_fcc = NULL;
dobj->attr_fci = NULL;
dobj->attr_fcc = NULL;
+ dobj->ref_prefix = NULL;
zov.handle = zend_objects_store_put(dobj,
(zend_objects_store_dtor_t) zend_objects_destroy_object,
1  markdowndoc_class.h
View
@@ -37,6 +37,7 @@ typedef struct discount_object {
zend_fcall_info_cache *url_fcc;
zend_fcall_info *attr_fci;
zend_fcall_info_cache *attr_fcc;
+ char *ref_prefix;
} discount_object;
extern zend_class_entry *markdowndoc_ce;
6 markdowndoc_meth_misc.c
View
@@ -201,7 +201,11 @@ PHP_METHOD(markdowndoc, setReferencePrefix)
RETURN_FALSE;
}
- mkd_ref_prefix(dobj->markdoc, prefix);
+ if (dobj->ref_prefix != NULL) {
+ efree(dobj->ref_prefix);
+ }
+ dobj->ref_prefix = estrndup(prefix, prefix_len);
+ mkd_ref_prefix(dobj->markdoc, dobj->ref_prefix);
RETURN_TRUE;
}
Please sign in to comment.
Something went wrong with that request. Please try again.