Skip to content

Commit

Permalink
MFH memory leak fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Schumann committed Dec 8, 2000
1 parent ac6d2d4 commit 40cd0d8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions main/php_logos.c
Expand Up @@ -33,15 +33,14 @@ HashTable phpinfo_logo_hash;

PHPAPI int php_register_info_logo(char *logo_string, char *mimetype, unsigned char *data, int size)
{
php_info_logo *info_logo = (php_info_logo *)malloc(sizeof(php_info_logo));
php_info_logo info_logo;

if(!info_logo) return FAILURE;
info_logo->mimetype = mimetype;
info_logo->mimelen = strlen(mimetype);
info_logo->data = data;
info_logo->size = size;
info_logo.mimetype = mimetype;
info_logo.mimelen = strlen(mimetype);
info_logo.data = data;
info_logo.size = size;

return zend_hash_add(&phpinfo_logo_hash, logo_string, strlen(logo_string), info_logo, sizeof(php_info_logo), NULL);
return zend_hash_add(&phpinfo_logo_hash, logo_string, strlen(logo_string), &info_logo, sizeof(php_info_logo), NULL);
}

PHPAPI int php_unregister_info_logos(char *logo_string)
Expand Down

0 comments on commit 40cd0d8

Please sign in to comment.