Diff

Differences From Artifact [7c0a1742a0]:

To Artifact [7e2a70b757]:


     9      9   #include <ppapi/cpp/instance.h>
    10     10   #include <ppapi/cpp/module.h>
    11     11   #include <ppapi/cpp/core.h>
    12     12   #include <ppapi/cpp/var.h>
    13     13   #include <ppapi/cpp/var_dictionary.h>
    14     14   #include <ppapi/cpp/var_array.h>
    15     15   #include <ppapi/cpp/var_array_buffer.h>
           16  +
           17  +#include <string.h>
           18  +#include <stdlib.h>
    16     19   
    17     20   #include "pcsc-nacl.h"
    18     21   #include "cackey-chrome.h"
    19     22   
    20     23   class CACKeyInstance : public pp::Instance {
    21     24   	private:
    22     25   		pp::Core *corePointer;
................................................................................
    50     53   			/*
    51     54   			 * Do the thing we are being asked to do
    52     55   			 */
    53     56   			reply = new pp::VarDictionary();
    54     57   
    55     58   			if (command.AsString() == "init") {
    56     59   				if (message->HasKey("smartcardManagerAppId")) {
    57         -					smartcardManagerAppId = message->Get("smartcardManagerAppId").AsString().c_str();
           60  +					smartcardManagerAppId = strdup(message->Get("smartcardManagerAppId").AsString().c_str());
    58     61   				}
    59     62   
    60     63   				pcscNaClInit(this, corePointer, smartcardManagerAppId, "CACKey");
           64  +
           65  +				free((void *) smartcardManagerAppId);
    61     66   
    62     67   				reply->Set("status", "success");
    63     68   			} else if (command.AsString() == "listcertificates") {
    64     69   				numCertificates = cackey_chrome_listCertificates(&certificates);
    65     70   
    66     71   				certificatesPPArray.SetLength(numCertificates);
    67     72